Seblod List field broken in admin view
Giuse69 opened this issue · comments
Hi, in Seblod 4.1.1, editing a content type in backed that includes a SEBLOD list field breaks with unrecoverable error
CRITICAL error Uncaught Throwable of type TypeError thrown with message "count(): Argument #1 ($value) must be of type Countable|array, null given". Stack trace: #0 [ROOT]/plugins/cck_field/cck_list/cck_list.php(364): include() #1 [ROOT]/plugins/cck_field/cck_list/cck_list.php(225): plgCCK_FieldCck_List::*render() #2 [ROOT]/libraries/cck/*/cck.php(34): plgCCK_FieldCck_List::onCCK_FieldBeforeRenderForm()
After some investigation, I see that the problem arises when in libraries/cck/base/list/list.php at line 209 there is
$data = $app->triggerEvent( 'onContentSearch', array( '', '', $ordering, $areas['active'], $fields, $fields_order, $config, $current, $options, $user ) );
and when this line is executed in backend/admin form, the result is assigned to $data[4] instead of $data[0], so the following lines to extract config and results fails since they try to be extracted from a null.
I don't know the cause of this. An ugly workaround is to switch between $data[0] and $data[4] according to which has values (precisely to which has a not zero size).
btw, triggerEvent is deprecated in J4.
still present in Seblod 4.2.0b..