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

php warning #7

Closed
magnushasselquist opened this issue Jun 2, 2023 · 4 comments
Closed

php warning #7

magnushasselquist opened this issue Jun 2, 2023 · 4 comments

Comments

@magnushasselquist
Copy link
Contributor

magnushasselquist commented Jun 2, 2023

Warning: foreach() argument must be of type array|object, null given in mod_cblistmodule/helper.php on line 92
(php version 8.0)
(latest version of cblistmodule)

@magnushasselquist
Copy link
Contributor Author

Hi! Did you gave a chance to look at this issue? Not urgent, but probably quick fix if you have a quick look. Thanks! /Magnus

@Tazzios
Copy link
Owner

Tazzios commented Aug 12, 2023

I lost a bit of motivation when trying to rebuild the PDF editor button fo rJ4

I looked at it but I have problems replicating. I do not know which one fieldtype you use; multicheckbox, multiselect, select or radio ? and what the users have selected.

@Tazzios
Copy link
Owner

Tazzios commented Aug 13, 2023

@magnushasselquist Now back in the correct issue instead of #6

The problem does occur when the field value is changed (or a choice gets deleted). The user then still has the old value in the comprofiler table which cannot be found in the comprofiler_field_values table. I do not see another way then using the value to get the data. Value should not be changed because it is the Identifier. Label on the other hand can be changed without a problem.

So you could click on save for every user (or check the in comprofiler table the column for wrong values) then it should also go away.

An other solution is placing this if around the foreach but I`m not sure i want to do that. Instead I maybe should give a warning that a user has an invalid value.

if(!empty($labels)) {
    FOREACH
}

magnushasselquist added a commit to magnushasselquist/cblistmodule that referenced this issue Oct 3, 2023
magnushasselquist added a commit to magnushasselquist/cblistmodule that referenced this issue Oct 3, 2023
Tazzios added a commit that referenced this issue Oct 7, 2023
Fix for #7
Fix php warnings with a non-filtered list and changed multiple choice options.
@Tazzios
Copy link
Owner

Tazzios commented Oct 7, 2023

V3.0.4 is published. :)

@Tazzios Tazzios closed this as completed Oct 7, 2023
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

2 participants