I have a custom post type "Funder", which has a Checkbox field "highlightfund". When I try to display this using a content template, I'm getting a fatal error:
Fatal error: Uncaught Error: Call to a member function get_value_filtered() on null in /www/voluntarysectorgatewaywestlo_847/public/wp-content/plugins/types/application/models/field/type/checkbox/view/frontend.php:33 Stack trace: #0 /www/voluntarysectorgatewaywestlo_847/public/wp-content/plugins/types/application/models/field/view.php(42): Types_Field_Type_Checkbox_View_Frontend->get_value() #1 /www/voluntarysectorgatewaywestlo_847/public/wp-content/plugins/types/application/models/field/service.php(145): Types_Field_View->render() #2 /www/voluntarysectorgatewaywestlo_847/public/wp-content/plugins/types/application/functions_public.php(58): Types_Field_Service->render_frontend(Object(Types_Field_Gateway_Wordpress_Post), Object(WP_Post), 'highlightfund', Array, '') #3 /www/voluntarysectorgatewaywestlo_847/public/wp-content/plugins/types/application/functions_public.php(34): types_render_postmeta('highlightfund', Array, '') #4 /www/voluntarysectorgatewaywestlo_847/public/wp-content/plugins/types/application/models/shortcode in /www/voluntarysectorgatewaywestlo_847/public/wp-content/plugins/types/application/models/field/type/checkbox/view/frontend.php on line 33
Content template has a single line:
Highlight Fund? [types field='highlightfund'][/types]
Here's the front end page showing the broken output: lien caché
Could you take a look please and see what's going on?
Thanks,
Chris
Hi, I'll be glad to take a closer look. I just ran a quick test on my local environment to see if I could reproduce a similar error when displaying a checkbox field value using a Types shortcode in a Content Template with Toolset Blocks, but I didn't see any errors like this. Can you try these troubleshooting steps first?
- Perhaps there was a problem during a Types update, and the plugin was not installed successfully. To test this, you can reinstall the latest version of Types by downloading the plugin from https://toolset.com/account/downloads. Then in your site's wp-admin area, go to Plugins > Installed Plugins and deactivate and delete the current version of Types. Go to Plugins > Add New and upload the new version of Types you downloaded from the site here.
- The same could be the problem for Toolset Blocks, so I would try downloading the latest version from https://toolset.com/account/downloads, then deactivate and delete the old version in wp-admin and reinstall the newest plugin.
- If manually reinstalling Types and Blocks does not resolve the fatal error, please try activating a default theme like Twenty Twenty One, and deactivate all plugins except Toolset Types and Toolset Blocks. If the problem is resolved, reactivate your theme and other plugins one by one until the problem returns.
Please include your site's debug information in your next reply as explained in our FAQ here: https://toolset.com/faq/provide-debug-information-faster-support/
Let me know the results of these tests, provide your debug information, and we can go from there. Thank you!
Hi Christian,
Thanks for getting back to me.
I've tried reinstalling Types and Blocks as you suggest, and switching to Twenty Twenty One theme, deactivating all other plugins, but unfortunately it's still giving the same error.
Debug info provided as requested.
If you could take a further look I'd appreciate that. As this is an early stage development site, it's no problem to give you access if that's helpful.
Thanks,
Chris
Okay thanks for the basic troubleshooting. Please provide login credentials in the private reply fields here and I will be glad to take a closer look. If I don't see anything obviously wrong, I may need to create a clone of this site using the Duplicator plugin to run additional tests locally.
Not sure what was happening here. I was trying a few things in wp-admin and I think I've solved the problem...somehow? I cleared the Views cache in Toolset > Settings > Frontend Content, I resaved the Funder Field Groups here: https://vsgwl.formandfunction.dev/wp-admin/admin.php?page=wpcf-edit&group_id=897 and cleared the Kinsta cache. Now I'm not seeing the error anymore. Very odd, but it does seem to be working now. Can you take a look and confirm or provide more details?
lien caché
lien caché
lien caché
lien caché
Brilliant! Yes, that seems to be working for me now as well.
It's very puzzling why it was happening. The only thing that's unusual with this site is that the data for the CPTs was imported from a Drupal site. We did this using a plugin called FG Drupal to WordPress Premium (lien caché), which uses Types to create the custom post types and custom fields. So the fields weren't created directly in Types but by this plugin - I wonder if there was some error in the structure of the field data, which was resolved when you resaved the field group?
Anyhow, that's fixed for me now. Thanks very much for your help.
Best wishes,
Chris
My issue is resolved now. Thank you!
Ah okay yes, I assume there was some problem during the conversion process. Resaving the field group set the proper structures in place. I haven't seen this specific problem before but glad to know it's working better now. Feel free to reach out if other problems pop up.