Skip Navigation

[Resolved] Fatal error: Undefined class constant WPML_CHECKBOX_SELECTED

This thread is resolved. Here is a description of the problem and solution.

Problem: I am seeing a PHP Fatal Error when trying to display a checked checkbox field: "Undefined class constant WPML_CHECKBOX_SELECTED".

Solution: Update to Types 3.0.6 to receive the hotfix for this issue.

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

Our next available supporter will start replying to tickets in about 0.74 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by Francesco 5 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#953651

Hi there,
please note that I am a Toolset and WPML contractor and I have performed an in-depth debug before posting this report.
Please escalate this report to the dev team.

I am trying to: use a custom field of type "checkbox"

Link to a page where the issue can be seen: not available

I expected to see: the value of the field as configured

Instead, I got: PHP Fatal error.

The error only occurs when displaying a post that has the checkbox field set to checked.

Here's the full stack trace:

Fatal error: Uncaught Error: Undefined class constant 'WPML_CHECKBOX_SELECTED' in /app/public/wp-content/plugins/types/application/models/field/part/option.php:139 
Stack trace: 
#0 /app/public/wp-content/plugins/types/application/models/field/abstract.php(219): Types_Field_Part_Option->get_value() 
#1 /app/public/wp-content/plugins/types/application/models/field/part/option.php(225): Types_Field_Abstract->get_value_filtered(Array, Object(Types_Field_Part_Option)) 
#2 /app/public/wp-content/plugins/types/application/models/field/type/checkbox/view/frontend.php(33): Types_Field_Part_Option->get_value_filtered(Array) 
#3 /app/public/wp-content/plugins/types/application/models/field/view.php(42): Types_Field_Type_Checkbox_View_Frontend->get_value() 
#4 /app/public/wp-content/plugins/types/application/models/field/service.php(137): Types_Field_View->render() 
#5 /app/public/wp-content/plugins/types/application/functions_public.php(58): Types_Field_Service->render_frontend(Object(Types_Field_Gateway_Wordpress_Post), Object(WP_Post), in /app/public/wp-content/plugins/types/application/models/field/part/option.php on line 139

The problem occurs also with WPML not installed, and despite the explicit reference to WPML, it's strictly related to Types source code, and not to WPML.

Fix: The bug is very trivial, the name of the constant looks wrong. It should be WPML_SUFFIX_CHECKBOX_SELECTED instead of WPML_CHECKBOX_SELECTED.

#953894

Thanks for the report, our developers have released the Types 3.0.6 hotfix which includes the fix for this bug. It is now available for download or automatic update. Please update and let me know if the issue is not fully resolved.

#954309

Thank you. I confirm the issue is fixed with the latest update.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.