Skip Navigation

[Resolved] Changed to front-end post form cannot be saved, JS error thrown

This support ticket is created 5 years 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.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 13 replies, has 2 voices.

Last updated by Beda 4 years, 11 months ago.

Assisted by: Beda.

Author
Posts
#1465555
error.png

I have my post form set to submit the form using AJAX, and keep displaying the form.

When the Submit button is pressed, whether or not any changes have been made to the form, a JS error is thrown after about 5 seconds (see error.png). If changes were made, they are not saved.

To duplicate,
1. Log in as per below.
2. On the next page, click the button "Edit Lodge Details"
3. Click the SAVE button (this is the form's submit button)

#1465795

This error is not happening on my local tests with similar setups.

I can't see how the form is built, or inserted, as the access shared isn't of an Admin.
However it would not help far, I think, as probably here we need to test the following things:

1. Does this happen without any custom code, inclusive CSS, JS and PHP?
2. Does this happen without other plugins and another theme?
3. Does it happen on a fresh form or even a clone of the same form?

Please let me know the results of these tests, I can then analyse the issue locally on a duplicate if we can't spot a direct culprit with above tests

#1466541

Hi Beda...the problem occurs when the "Anti-spam by Cleantalk" plugin is active.

#1470621

Please can you provide me with a link to download the plugin, some contact to the author, and the steps I need to follow to produce the error?

I can then replicate, analyse and eventually suggest some adjustments.

Please also report the error the other plugin. We may reach out to each other if we determine the issue is in either's plugin.

#1470639

The plugin is at hidden link. Contact details on the site. Steps are above. I was able to disable spam checking on this page for now. But this bug should be fixed.

#1470685

We can help to resolve compatibility issues.
Often, the issue is not within Toolset, but we still will help with this.

However, to do so we need very specific data and collaboration.

1. We need an email or other means of contact of the 3rd party. Please ask the Developers of that plugin where they'd like us to reach out in case we need to. We would prefer not to do this in forms or emails "gathered in the wild" but directly to the address the developer of the third party suggests us/you too.
2. However, this can wait until we confirm the issue. We can only help with Software that is publicly available, usually, and for paid software, we need either a copy of the software shared by the user (you, in this case) or by the third party if we have existing contacts.
We do not have existing contacts and there is yet also no reason for it as it is not confirmed if the bug is in Toolset or that plugin
3. Once we have the steps, and software to replicate the issue, we replicate it and debug it.

Then, we can reach out to the third party or fix the bug in Toolset.

Can you help me with this?

Note, the ticket will stay escalated to compatibility during all this process so I can notify you once it is fixed in either software.

#1470691

Contact them at welcome@cleantalk.org. You can also get the software from https://wordpress.org/plugins/cleantalk-spam-protect/, it's free.

#1470699

Yes, but that is not helping us to replicate this issue.
The plugin does require a purchase key, to work.

In fact, just installing and activating it will not provoke any error with Toolset Forms AJAX submit, I tested that.

Can you provide me with the steps, as I previously mentioned, so I can replicate the issue easily?
I will activate the private form again so you can also share private data if required.

Thank you for your cooperation!

#1470705

I can give you a Duplicator package of my site (with the spam protection turned ON for this form), then the steps are (using the clone of my site):

1. Log in using credentials I'll also share.
2. On the next page, click the button "Edit Lodge Details"
3. Click the SAVE button (this is the form's submit button)

Would this help?

#1470717

The private information to this thread was removed the very moment you had marked "my problem is resolved".
This resolved the thread and removed the private details.

I think a duplicate could help, as it'll have the registered plugin set in the database.
I've re-activated a private reply for it to be submitted safely.

#1479923
#1482429

I'm downloading the package now and will update you as soon I have news about this issue.

#1484587

I can't access the wp-admin backend on this site.

When enabling WP Debug, I received a lot of errors:

Notice: register_rest_route was called <strong>incorrectly</strong>. REST API routes must be registered on the coderest_api_initcode action. Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 5.1.0.) in .../wp-includes/functions.php on line 4986

A "This has been disabled." message displays for the WP Admin.

Only disabling all plugins let me log in to the duplicate.

I've then logged in and re-enabled Theme Twenty Twenty, and Toolset, plus the Anti-spam by Cleantalk plugin.

But I can't see anything on my new site.test/lodge-admin/lodge-details/
That was because I am not the author of any such lodge, it seems, so I removed that query from the view in the duplicate.
That broke the site with a PHP Fatal error: Maximum execution time of 30 seconds exceeded in .../wp-views/embedded/inc/wpv-shortcodes-in-shortcodes.php on line 85
It seems some nesting of shortcodes is done too many times and the view runs out on memory. So I have scaled back to 1 posts, which after a long loading time, showed me 1 lodge to edit.

Each item there in that loop loads an entire (huge) Toolset Edit Form submitted with AJAX.
These are known to have issues currently in the Views, which will be resolved in the next release (but the particular issues aren't affecting us here)

There are on the load of the View already a 150 JS errors, but luckily they are all 404 on the images.

I found no submit button on the form at all.
I see you use this form wp-admin/post.php?post=7149&action=edit and was able to see that you use a "Save" label so I could spot the saving button and pressed it.
This triggered the AJAX update of the form, and all the 150 JS errors on missing images, but no other JS error at all.

Am I doing something wrong?
Can you elaborate on how I can easily see this issue on the duplicate?
It seems to me, even with the particular plugin, it works (apart of the many missing images, which is not unexpected given these are excluded in the duplicate)

#1485443

Hi Beda,

I re-enabled CleanTalk AntiSpam for the form in question, and now I'm not getting the error either.

No idea. I'll let you know if it returns and how to duplicate it.

#1486143

Yes, please let me know.

It might be related to activation sequence, sometimes, if different script versions are loaded, that can affect the issue.