Skip Navigation

[Resolved] Block contains unexpected or invalid content. Can’t be recovered

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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 7 replies, has 1 voice.

Last updated by Minesh 2 months ago.

Assisted by: Minesh.

Author
Posts
#2804083

I have a simple template. It is showing the errors "Block contains unexpected or invalid content."
Attempt recovery does nothing.

Video
hidden link

Template
hidden link

#2804084

Here is another one. This one can be recovered but I want to make a note of how many there are hidden link

Again, not a very complex template. I'm mentioning this because I've been told that complex templates cause this.

Again, it can be recovered, but I have not saved the attempt to recover, so you can see. These corruptions seem to happen all the time. If I save this now, in a while, it will probably corrupt again.

#2804098

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I can see it wroking:
- hidden link

And for:
- hidden link

I see the container block is added like this - you can delete and add the fresh container block and display your content as required.

[tb-dynamic-container provider='__current_post' source='post-title' field='']<h2 class="tb-heading" data-toolset-blocks-heading="1" data-last-update="1.4"><i class="bi bi-bookmark-check-fill"></i> [tb-dynamic provider='__current_post' post='current' source='post-title' force-string='first' ]</h2>[/tb-dynamic-container]

I can see the shortcode block which has the following content - I'm not sure why, you should try to readd the requied view with shortcode block in proper way. This is not the right way to pass the view's shortcode argument:

exerciseid="[tb-dynamic provider='toolset_relationship|exercise|parent' post='current' source='post-id' force-string='first' ]"

[wpv-view name="exercise-progress-graph" exerciseid="[tb-dynamic provider='toolset_relationship|exercise|parent' post='current' source='post-id' force-string='first' ]" progresstypeid="[types field='progress-type' output='normal'][/types]"]
#2804411

I find it very hard to make any sense of your replies.

You write: " This is not the right way to pass the view's shortcode argument:"

You then post two examples, and one would think the second one is the correct way of doing what you point out is wrong, but it's not, it's exactly the same. One would also think, when you point out there is something not right, you would explain what exactly is not right and why?

As for not seeing what you see, there is an autosave, which means you didn't actually save whatever you did. So, I won't see it until you actually save it, can you save it so I can see it?

#2804412
post-8462.jpg

Screenshot attached for this post hidden link

Next, how does all this corruption happen and how will it be prevented from happening in the future?

#2804423

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

You write: " This is not the right way to pass the view's shortcode argument:"
===>
It's while using Toolest Block view. With legacy views you can do that.

You then post two examples, and one would think the second one is the correct way of doing what you point out is wrong, but it's not, it's exactly the same. One would also think, when you point out there is something not right, you would explain what exactly is not right and why?
====>
I did not posted any example but what I find on your page.

See the related ticket where I've shared example how to use view's shortcode attribute:
- https://toolset.com/forums/topic/how-to-display-the-number-of-records-by-search-filter-2/#post-2804079

What I find on your page is this:

[wpv-view name="exercise-progress-graph" exerciseid="[tb-dynamic provider='toolset_relationship|exercise|parent' post='current' source='post-id' force-string='first' ]" progresstypeid="[types field='progress-type' output='normal'][/types]"]

As you can see you are passing blocks generated code as view's shortcode attribute:

exerciseid="[tb-dynamic provider='toolset_relationship|exercise|parent' post='current' source='post-id' force-string='first' ]"

This is not the correct way.

As for not seeing what you see, there is an autosave, which means you didn't actually save whatever you did. So, I won't see it until you actually save it, can you save it so I can see it?
===========>
You can either extend the auto-save interval by adding the folloiwing line of code to your wp-config.php file:

define('AUTOSAVE_INTERVAL', 600);

if you want to disable the auto save then you should try to add the following line of code to your wp-config.php file:

define('AUTOSAVE_INTERVAL', false);

More info:
- hidden link

You are making it difficult even for us and we can guide you but you should take decision soon where you want to use blocks and where legacy views. As instructed before, if you have hundreds of conditions and blocks I suggest you build the content template and views in legacy mode.

Now regarding your last reply:
- https://toolset.com/forums/topic/block-contains-unexpected-or-invalid-content-cant-be-recovered/#post-2804412
===========>
This is not corrupted but you see block is working as but the rendered output is link and added to column block so its block generated output in backend, its not couupted.

#2804457

You are making things extremely difficult.

Here is my previous response "As for not seeing what you see, there is an autosave, which means you didn't actually save whatever you did. So, I won't see it until you actually save it, can you save it so I can see it?"

You said that you see something different than me, I explained to you why that is, it is because YOU DID NOT SAVE IT! I'm not asking to extend the auto save, I asked you to save the actual post that you edited so that I can see what you see.
------

"You are making it difficult even for us and we can guide you but you should take decision soon where you want to use blocks and where legacy views."

1) are you saying that ALL the content that is having issues is due to including blocks generated code?
2) are you saying that I should convert all the templates using blocks to plain views?
3) where are you at with fixing all the issues? Can you address the list I posted so I don't need to post it again

#2804467

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - I did not saved anything.

*** Please make a FULL BACKUP of your database and website.***

I'm asking to do the following:
- Open this page: hidden link
- At top of the page you will see the following:

[tb-dynamic-container provider='__current_post' source='post-title' field='']<h2 class="tb-heading" data-toolset-blocks-heading="1" data-last-update="1.4"><i class="bi bi-bookmark-check-fill"></i> [tb-dynamic provider='__current_post' post='current' source='post-title' force-string='first' ]</h2>[/tb-dynamic-container]

So above is not the expected thing and it seems its displyaing the continer block and inside container block there is heading block added to display post title.

You should delete the above code and then inplace of that you should add container block and add a heading block inside the container block and display the post title as required.

If you go down further you will see another shortcode block that has the following value:

[wpv-view name="exercise-progress-graph" exerciseid="[tb-dynamic provider='toolset_relationship|exercise|parent' post='current' source='post-id' force-string='first' ]" progresstypeid="[types field='progress-type' output='normal'][/types]"]

Again, this is not expected and how you pass the view's shortcode attribute. See how you pass the view's shortcode attribute - the following is NOT CORRECT:

exerciseid="[tb-dynamic provider='toolset_relationship|exercise|parent' post='current' source='post-id' force-string='first' ]" 

The another shortcode attribute is you pass is correct - this is how you pass as follows.

progresstypeid="[types field='progress-type' output='normal'][/types]"

You can fix this shortcode attribute "exerciseid" with correct types shortcode.

I'm not saving or doing anything I'm asking you to fix yourself.