Hi Meta Box Team,
After updating to the latest version, I encountered this fatal error:
PHP Fatal error: Uncaught TypeError: MB_Conditional_Logic::parse_condition(): Argument #1 ($condition) must be of type array, bool given
This error did not occur before updating, and rolling back to the previous version fixes it.
My Implementation of Conditional Logic
I use the visible key to show/hide fields based on user roles and form conditions.
Some fields return hidden if they are not needed (i have a complex form and I have implemnented this logic a lot - it worked well):
$empty = [
'type' => 'hidden',
'class' => 'empty-div-hidden',
];
The visible condition typically looks like this:
'visible' => [
'when' => [['advisor_status', '=', 'unavailable']],
'relation' => 'and',
],
In some cases, visible may be empty or evaluate to false, which may be causing the issue.
Suspected Issue
It looks like Meta Box now requires an array for all conditions, and false or an empty array may be causing a TypeError.
Previously, if when conditions were not met, fields would return a hidden field or be ignored, but now it seems Meta Box doesn't handle this the same way.
Would appreciate any guidance on this—should I change how I handle visible conditions, or is this a bug in the latest update?
Thanks!
Yasmine