Skip Navigation

[Resolved] Content broken with View 3.0

This support ticket is created 4 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 12 replies, has 3 voices.

Last updated by Guillaume 4 years, 1 month ago.

Assisted by: Nigel.

Author
Posts
#1489103

Hello.

This ticket follow my previous ticket "Content broken with the last version of view 3.0.1". It has been marked as solved but it's not.

After some tests I still don't understand why my content is broken after the update.

Here is my problem :

I have posts where I have inserted some Gutemberg View Bloc. There are more than 1 view bloc per post and I use the function offset and limit on each.

After the update to View 3.0 my posts in the front-office looks good but... If I want to edit a post in the editor there is an error. The first View block show the message "This block contains unexpected or invalid content." I can resolve or convert to HTML. If i convert I lost my filter, offset and limit setting for this view. The biggest problem I have is that the other view blocks are deleted, they are not there anymore. My paragraphs inserted between the View block are deleted too.

Moreover i noticed if I add some content after the last View block this content is not deleted. It looks like the content between the 1st view block to the last one is mixed and deleted after in the wordpress editor.

To sum up : the new View system introduced in the 3.0 do not convert my content properly. I think there is a bug.

Thanks

#1489215

I see the previous ticket was closed by the robot as no reply came:
https://toolset.com/forums/topic/content-broken-with-the-last-version-of-view-3-0-1/page/2/#post-1443069
It mentions there the Views where inserted somehow without Slugs, and without Slugs, they can't display, in this ShortCode.

However, I am not sure how that was the conclusion of the problem since what you mention here on your new ticket and there on the old ticket's first comment is totally unrelated to any slug in Views shortcodes, it instead complains that there is an error on blocks in edit post screens:
"This block contains unexpected or invalid content."

This happens on specific content created with Blocks during the Beta phase. I suspect this is the case on your install, you can see the other threads about this here below:
https://toolset.com/forums/topic/block-editor-map-view-filter-results-not-correct/
https://toolset.com/forums/topic/views-displays-empty-loop-for-event-calendar/
https://toolset.com/forums/topic/this-block-contains-unexpected-or-invalid-content-2/

Generally, this was only to be solved like this:
1. Attempt block recovery from the "3-dot" menu on the side of the block.
2. If that does not work, check if it works after purging cache (if any)
3. If that also does not work, or the issue comes back after it initially disappears, please report this issue to us.

Can you try these steps?
In case it works, and in case you started using Blocks with the beta versions, or very early stable release, this is likely the issue, and it should be solved with the first step above listed.
Do not CONVERT, do "ATTEMPT TO RECOVER"

This should only happen on named "older" contents made with the beta, or early releases of the blocks features.

If that does not work, or I miss some detail please if possible provide me with a copy of the site so I can locally check that and eventually find the issue and solution.
https://toolset.com/faq/provide-supporters-copy-site/

Thanks!

#1489279

Hello,

Yes don't take attention to the slug problem because it's a mistake from me and it's not linked to this problem.

First of all I've disabled all plugin except Toolset so It's not a compatibility problem.
I tried the 3 dots and attempt to recover : when there is only 1 view on the page it works, but when I have more than 1 view block I still have the problem. I can recover the 1st view but the content after and the other views are missing (deleted) in the editor, so if I save or WordPress autosave the post I lost most part of my post.

All my views and view templates are new from late 2019, it's not old content.

Thanks

#1489313

Ok, can you please send me a copy of the site, possibly in a "broken" state previous to recovery attempt?

Or even better if you have a copy of the still working site, and can instruct us what to do to "break" it, in both cases, we can take a look and see what causes this so to fix it.

I am back next Tuesday, but I will ask my colleagues to look here if you can submit such package (see https://toolset.com/faq/provide-supporters-copy-site/ for how to create a copy) so we could expedite it.

Thank you!

#1491721

There are over 40 plugins active on this website, are you sure none of them is causing the issue?
Because locally I can't spot the issue, but that might be due to missing a link any backend Post where I see the issue.
I found a few posts they have Views inserted but those are added as ShortCodes and work perfectly.

Can you elaborate where on the duplicate Database I see the issue?

#1491735

Yes I confirm it's not linked to another plugin because I had the same issue after I disabled all of the plugins except View and Types.

Yes, some of my old posts use the shortcodes and are not affected when I upgrade the View plugin. It works great.

You can see the issue on the post id 82052 called "TIMBERLAND | 30 Chaussures Timberland pour Homme en 2020".

Thanks.

#1491747

OK, I found that but there is only one View there, and the suggested workaround as elaborated before solved the issue.
The View in question there is "RASM Liens Annexes List"

I clicked on the 3 dots, selected attempt recovery, and that resolved the issue.
But this view uses neither offset or limit so I suspect we are not talking about the same content.

When I fix the view and reload that post, this breaks again because actually the post can't save.
It should hence be due to the early versions of last year that caused such issues, which are now resolved, but since the post can't be saved to start with (Updating failed. Error message: The response is not a valid JSON response.), when "attempt the recovery" that does not stick but reverts to previous (broken version)

I've seen there are some 60 JS errors in that page, one of them being an error of View trying to save a View <div class="wp-block-toolset-views-view-editor ">[wpv-view name="liens-annexes-list" numero="1"]</div> instead of <div class="wp-block-toolset-views-view-editor ">[wpv-view name="liens-annexes-list"]</div>
All API calls also seem to fail and return errors in the console.

But I cannot really test on this testing site because even just activating another theme redirects to your live site.
Can you provide me a duplicate fabricated with https://toolset.com/toolset-support-policy/ so to avoid this?
It seems there are customizations in place to redirect which must be stored somewhere in the database.
Maybe it is possible to avoid those with a full duplicate.

I've reactivated the private replies.

#1503601

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Beda has a few days vacation, so let me take over here.

I will download the duplicate you just shared and investigate the post in question.

I'll update you again when I have taken a closer look.

#1504909

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

I managed to identify the problem and then reproduce it on my own test site.

It occurs where you have a View with a Query Filter that takes some value from a shortcode attribute, and where the View block passes a value to the View via the shortcode attribute.

I don't think you would have such a problem were you to insert the Views in a shortcode block, for example, which I note you have also done on the same post I was editing.

But you may have used this technique in many places and it is too much for you to replace such instances, so I don't know if that is a viable workaround while waiting for the developers to produce a fix.

In any case, I'm escalating this so that they can take a look, and I'll let you know what happens.

#1505225

You're right, I used the view shortcode before Gutemberg so I have sometimes view block or shortcode depending on post.

If there is an easy way to update all view blocks to shortcodes it's ok for me. Then I will use the new version of view.

Thanks for your help.

#1528109

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Quick update to let you know that this will be fixed in the next release of Views/Blocks.

In the meantime a patch is available in the linked erratum if you want to try that before the official release: https://toolset.com/errata/legacy-view-blocks-are-broken-after-migrating-to-views-3-x/

Let me know if you have any problems once applied.

#1528245

Great, I did not expect you were still working on it.
I will try the fix today.

Thanks.

#1528877

My issue is resolved now. Thank you!

Thanks. I tried the fix and it works great.
I really appreciate your help on this ticket.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.