I am trying to:
Submit a form
Link to a page where the issue can be seen:
It's currently hidden but I can give you login details if you want.
I expected to see:
The form working
Instead, I got:
Fatal error: Uncaught Error: Call to undefined function get_current_screen() in /www/htdocs/xxxxxxxxxxxx/digitalmarketing.at/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/utility/condition/post_type/editor/is_block.php:67 Stack trace: #0 /www/htdocs/xxxxxxxxxxxx/digitalmarketing.at/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/utility/condition/post_type/editor/is_block.php(32): Toolset_Condition_Post_Type_Editor_Is_Block->get_post_type_by_current_screen() #1 /www/htdocs/xxxxxxxxxxxx/digitalmarketing.at/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/toolset-forms/classes/class.conditional.php(157): Toolset_Condition_Post_Type_Editor_Is_Block->is_met() #2 /www/htdocs/xxxxxxxxxxxx/digitalmarketing.at/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/toolset-forms/classes/class.conditional.php(121): WPToolset_Forms_Conditional->get_block_editor_form_selectors() #3 /www/htdocs/xxxxxxxxxxxx/digitalmarketing.at/wp-content/plugins/cred-frontend-editor/vendor/ in /www/htdocs/w00bb115/digitalmarketing.at/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/utility/condition/post_type/editor/is_block.php on line 67
A couple of things to note.
The form had a lot of custom JS in it originally and was working earlier today. I made some changes to the form content, the js and to the fields on the custom post type - added some fields and removed others.
I tried the following:
- switching off ajax submission (the original error message had no detail and it wasn't till I switchedoff ajax that I got the whole error message
- removing the JS
- regenerating the form using "Auto generate form content"
- switching off the "Charge payment with this form"
- updating all Toolset plugins
- site doesn't use Jetpack. I didn't test turning other plugins off
It seems it may be related to this problem, but with a different file:
https://toolset.com/forums/topic/call-to-undefined-function-get_current_screen-in-classesclass-file-php/
I used the solution in this support topic and it seems to have done the trick, but like this user I could do with a solution that doesn't involve changes to a Toolset file.
Thanks
Tim
Hello,
Thanks for the details, I can login your website, but there are lots of forms in your website, I am not sure where I can check the problem.
Please try these:
1) In case it is a compatibility problem, please deactivate other plugins, and switch to wordpress default theme 2017, and test again
2) If the problem still persists, please provide database dump file(ZIP file) of your website, also point out the problem page URL and form URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/
I've just performed the latest round of updates (to Types 3.2, Access 2.6, Forms 2.2, Views 2.7 & Maps 1.7) and I'm getting the same errors. I'll raise a separate ticket.
@julieP, thanks for the feedback, we got some other similar reports, for example:
https://toolset.com/forums/topic/jquery-bug-rendering-repeatable-fields-unusable/
And they should be the same problem, I have escalated this thread to our 2nd tier supporters, will update here if there is any news.
Hi Luo,
I should have said, the form in question is:
Add New Job Listing
Found at: /add-new-job-listing/
Other forms seem to be working OK.
Tim
That doesn't look like much of a fix.
"Workaround
There is no solution just yet, unless to not use such fields."
Yes, there is only a workaround for it. And our developers are working on it, I will keep on updating here.
Here is the feedback from our developers:
This is caused by Toolse fields, some of which have default validation rules, so no need to check for specific field types.
Types 3.2.1 released with a fix for problem, you can download it here:
https://toolset.com/account/downloads/
please test it again, thanks
My issue is resolved now. Thank you!