Skip Navigation

[Resolved] Critical error when creating content template on some Post Types.

This support ticket is created 3 years, 11 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.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9: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: Africa/Casablanca (GMT+01:00)

This topic contains 9 replies, has 3 voices.

Last updated by igorL-3 3 years, 11 months ago.

Assisted by: Jamal.

Author
Posts
#1983541
Screenshot_2021-03-12 Toolset Dashboard ‹ The Borzoï Encyclopedia — WordPress.png
Screenshot_2021-03-12 WordPress › Error.png

I am trying to: Create Content Template. This doesn't happen for all Post Types only for some. For thoses that it works I get the editor screen. When it fails I get Critical error similar to the text I'm posting. I have turned the DEBUG flag to true! The template is created as I can see it in the template lists. I have deleted it and tried again but still same error. If this is relevant I have migrated a DRUPAL site to WP using hidden link pugin.

Link to a page where the issue can be seen: I'm using a local development site not visable to ouside

I expected to see: Editor page as is the case with some Post types.

Instead, I got: Fatal error: Uncaught Error: Call to a member function get_value_filtered() on null in /Users/Tanya/Sites/www/wordpress.test/wp-content/plugins/types/application/models/field/type/checkbox/view/frontend.php:33 Stack trace: #0 /Users/Tanya/Sites/www/wordpress.test/wp-content/plugins/types/application/models/field/view.php(42): Types_Field_Type_Checkbox_View_Frontend->get_value() #1 /Users/Tanya/Sites/www/wordpress.test/wp-content/plugins/types/application/models/field/service.php(145): Types_Field_View->render() #2 /Users/Tanya/Sites/www/wordpress.test/wp-content/plugins/types/application/functions_public.php(58): Types_Field_Service->render_frontend(Object(Types_Field_Gateway_Wordpress_Post), Object(WP_Post), 'archived', Array, NULL) #3 /Users/Tanya/Sites/www/wordpress.test/wp-content/plugins/types/application/functions_public.php(34): types_render_postmeta('archived', Array, NULL) #4 /Users/Tanya/Sites/www/wordpress.test/wp-content/plugins/toolset-blocks/vendor/toolset/dynamic-sources/server/ToolsetSources/FieldInstanceM in /Users/Tanya/Sites/www/wordpress.test/wp-content/plugins/types/application/models/field/type/checkbox/view/frontend.php on line 33

There has been a critical error on this website. Please check your site admin email inbox for instructions.

#1983761

Nigel
Supporter

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

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

The message appears to relate to a checkboxes field.

Could you verify if the specific templates that this issue occurs on are for post types that have a custom field group assigned which includes a Types checkboxes field?

If this is a local site that we cannot access, could you share a screenshot of the settings for the checkboxes field when editing the custom field group listed at Toolset > Custom Fields.

Are you able to retrieve content directly from the database? That is, are you familiar with using something like phpMyAdmin to inspect the database?

Could you look for a post that has a checkboxes field and locate it in wp_postmeta and show what is stored there? (Note, Types custom fields are stored in wp_postmeta with a 'wpcf-' prefix, so if you had a checkboxes field with a slug of 'my-checkboxes' then it would actually be stored in wp_postmeta with the key 'wpcf-my-checkboxes'.

#1986561
Screenshot_2021-03-13 localhost localhost wordpress phpMyAdmin 4 9 7.png
Screenshot_2021-03-13 Edit Group ‹ The Borzoï Encyclopedia — WordPress.png
Screenshot_2021-03-13 Edit Art ‹ The Borzoï Encyclopedia — WordPress.png
Screenshot_2021-03-13 Edit Group ‹ The Borzoï Encyclopedia — WordPress(1).png

Hello,
Yes you're right the first post type I tried to create a template on does have checkbox fields. I'm attaching the screenshots as you requested. I also went into phpMyAdmin and serached for 'wpcf-my-checkboxes' in 'wp_postmeta'. and nothing was found. I'm attaching a screenshot af that as well.

Thank you in advance

#1986597

sorry I submitted the above twceso I tried to delete the 2nd one

#1986743

I don't know how the FG Drupal to WordPress plugin works. I could not find any reference to it in our migration guide. https://toolset.com/documentation/programmer-reference/guide-drupal-developers-switching-wordpress/

From the error, it seems that the code search for a custom field "archived". And from the screenshot, there is indeed a checkbox custom field "archived" in the fields for Arts. I assume that you encounter these errors when trying to create a content template for Art custom post type, right? Can you tell for what custom post types these errors appear?

Can you search the database again, using phpMyAdmin for the keyword "wpcf-archived" and for the keyword "archived" and share the screenshots?

Finally, we might need to take a copy of your website and analyze it. In that case, we'll ask you to provide a Duplicator or All In One Migration package through a sharing service(GDrive, Dropbox).

#1986835
Screenshot_2021-03-15 localhost localhost wordpress phpMyAdmin 4 9 7.png
Screenshot_2021-03-15 localhost localhost wordpress phpMyAdmin 4 9 7(1).png

Hello,

Yes I've done the above search and am attaching the screenshots.
I’ve also moved the local site to the production server so that you may have access.

The site is hidden link

It may raise a security flag. Not sure why and as this is only a test at the moment I don't want to truy to solve it but it does work if you allow the exception

how can I give you the credentials to go into the admin section?

#1986901

Can you change the configuration of the checkbox field to save 0 when the field is unchecked? Check this screenshot hidden link
Then, try to create a new template and check if the issue persists.

If that does not help, allow me temporary access to your website and let me know for what custom post types the issue appears?
Your next reply will be private to let you share credentials safely.

#1987077

Hello,
Thank you for that. The small change to save 0 has helped. But now I have a paralell problem that may be related. When I try to create an Archive, on any custom post, instead of giving me an editor page I get a black page. Is there another flag, similar to the checkbox, I need to select. It's just a black page no error message of any kind

New threads created by Jamal and linked to this one are listed below:

https://toolset.com/forums/topic/unable-to-create-archive-templates/

#1987095

Awesome. I am glad I could help. However, for support rules, we are able to handle only one issue at a time. This helps us to bring you a better service and also helps other users to find all the information here exposed. For that reason, I have created another ticket to help you with this issue. I'll be posting my replies there.

#1987135

My issue is resolved now. Thank you!