Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seblod List field broken in admin view #776

Open
Giuse69 opened this issue Oct 21, 2023 · 1 comment
Open

Seblod List field broken in admin view #776

Giuse69 opened this issue Oct 21, 2023 · 1 comment

Comments

@Giuse69
Copy link
Contributor

Giuse69 commented Oct 21, 2023

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.

@Giuse69
Copy link
Contributor Author

Giuse69 commented Dec 15, 2023

still present in Seblod 4.2.0b..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant