Problem/Motivation
If there are no lists checked on the "Constant Contact Available Lists" page (admin/config/services/ik-constant-contact/lists), then adding the "Constant Contact Multiple Lists Signup Form" block will lead to a HTTP 500 status with this error:
TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in count() (line 64 of /var/www/html/dv8.openplus.ca/html/core/lib/Drupal/Core/Render/Element/Checkboxes.php).
Steps to reproduce
Add a block while there are no lists check on admin/config/services/ik-constant-contact/lists.
Proposed resolution
Make the code robust against an empty value.
Remaining tasks
Implement.
User interface changes
Avoids a HTTP 500 status.
API changes
None.
Data model changes
None.
Issue fork ik_constant_contact-3532829
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
rosemaryreilmanComment #4
rosemaryreilmanI created a PR to see if just adding an empty options array will suffice. It may not since the default value = NULL if there's no other config set. It may error but I'm unable to test it at the moment. Marking as needing review. If you have a chance and can use the patch from the PR, let me know if that clears the error for you. Thank you!
Comment #5
liam morlandThis seems to have fixed it for me.
Comment #6
rosemaryreilmanFixed in 4.2.3
Comment #7
rosemaryreilmanComment #8
liam morlandThis wasn't merged.
Comment #9
rosemaryreilmanAck, sorry about that. Created 4.2.4.
Comment #10
liam morlandThanks. There are some
previoustags left behind by this in the main repo.