Skip Navigation

[Resolved] The editor has encountered an unexpected error

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 11 replies, has 1 voice.

Last updated by Minesh 2 months, 1 week ago.

Assisted by: Minesh.

Author
Posts
#2802767
Untitled-2.jpg

I am trying to: Edit a template

Link to a page where the issue can be seen: see screenshot

I expected to see: my template

Instead, I got: an error "The editor has encountered an unexpected error"

SyntaxError: Expected property name or '}' in JSON at position 1 (line 1 column 2)
at JSON.parse (<anonymous>)
at save (hidden link)
at Qr (hidden link)
at Zr (hidden link)
at hidden link
at co (hidden link)
at hidden link
at uo (hidden link)
at hidden link
at Array.reduce (<anonymous>)

I previously spoke about this in my other issue https://toolset.com/forums/topic/template-times-out/ but I realize it's best to create a separate bug.

I also reported that the templates corrupt. Would you like me to make another bug report that as well?

You already have access to the site and have downloaded the files.

In summary: There are currently three major error stopping me from using Toolset.
1) Templates timing out
2) Templates corrupting
3) Templates becoming inaccessible and produce an error as shown in this ticket

#2802813

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I'm not sure why you are the one having such issues as I do not see any other user in recent time who reproted such issue that you reported recently.

However - as I shared with previous ticket, can you please try to update the PHP version to PHP 8.0.x or 8.1.x or 8.2.x and check if you see any improvements? If no:
- As I shared I will require latest duplicator copy of your live/production site in order to debut the issue further.

*** Please make a FULL BACKUP of your database and website.***
I have set the next reply to private which means only you and I have access to it.

#2802841

I have given the full backup/clone in another reply.

As for PHP, I have it on 8 now but it will take a while to see if anything still happens, when it does, I will let you know. I still can't access the templates that errored though.

As for templates corrupting, I have had that for a while, just never bothered to report it as I hoped it would go away after an update of the plugin. I would either not update the template anymore or have to redo the whole template. Right now, we're getting serious with the website, and other issues appeared as well,l so I reported it as I can't continue like this.

#2802882

I promised I would let you know if I still got problems after going to php8
I do. A new template just errored

hidden link
You won't have this one in your copy.

#2802886

Minesh
Supporter

Languages: English (English )

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

Do you mean you just try to create a new content template and that throw the error? if yes:
- Please allow me to download and install your site copy on my local machine and I will get back to you as soon as I can.

#2802887

Yes.
Upgraded PHP
New template
Saved a few times, and then out of the blue, it errors.
The same errors keep showing up that I posted the first time from the log, you said they didn't mean anything, but would that not be the first place to look?

#2803439

Minesh
Supporter

Languages: English (English )

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

ok - So I see there is issue when you add Form block to the content template you are editing.

With your content template - I see you added few block and with single field block you are trying to display the post body (content).

please check now:
- hidden link

To display post body and form I've added the shortcode block and within shortcode block I've added the post body shortcode to display post body:

[wpv-post-body view_template="None"]

And with another shortcode block I've added the form:

[cred_form form="add-progress-item"]
#2803445

Let me be 1000% clear, I do not add that, I have never typed that, your system adds it. So, it's a bug.
In fact, I think it's there when you create a template/view and convert it to blocks. Happy that you found the issue though, will you fix it everywhere?

#2803611

I just read it again, and I see now that you are saying instead of using blocks I should be using the shortcodes.

I'm so confused. You are making it sound like I did something wrong by selecting the available fields. If I should not be using the blocks to display the body or forms, why are they available?

Just to confirm, you are saying I should not be using the block editor to display the body of the post or a form, is that correct?
I've obviously done that everywhere, so how do we find each one and replace it?

I have been using blocks to display the body and forms ever since the blocks were there, and I am confused that this just became an issue.

#2803626

Minesh
Supporter

Languages: English (English )

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

Obviously, you should be using single block to display post content and forms block to display the form but specific to your site its not working.

It's related to your site specific setup and adivsed accordingly and have less changes that it should get broken.

I do not see any other users reported the same issue otherwise we will have tons of tickets and our support queue will be full.

Evem I just checked with brand new sandbox site and you can auto-login to it using the following link:
- hidden link

As you can see I've created Book post type and created the following single post content template to display single book post:
- hidden link
Where:
- I've added single block to display post title with link
- I've added single block to display post post content
- I've added forms block to dispaly the form

it works without any issues but on your site as soon as I add the form block, the page is broken and do not redner any block added to the following content template:
- hidden link

I do not have any other solution to offer at the moment and its not a bug (for now) but specific to your site.

If you able to reproduce any issue with Toolset plugins active, you're welcome to share exact step information that should help me to reproduce the same issue and if confirm we are happy to escalate it in front of our Devs including compatibility with any plugins/theme we can consider that as compatibility or bug.

#2803671

Okay. Out of the 5 issues reported, issue 1 is fixed.

I've lost which one this relates to, but I understand you are saying I should not use the block editor for Body Content or Forms. Fine, how do we get these converted on the live website without converting the full template completely to the non-block editor?

#2803672

Minesh
Supporter

Languages: English (English )

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

I've lost which one this relates to, but I understand you are saying I should not use the block editor for Body Content or Forms. Fine, how do we get these converted on the live website without converting the full template completely to the non-block editor?
===>
Well - you will have to update the database record based on the query I share or content I shared.

Glad to know that ow it wroks. You're welcome to close this ticket and we will continue with other tickets.