Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in array_filter() (line 141 of modules/contrib/ckeditor5_font/src/FontColorsManager.php).
Comment | File | Size | Author |
---|---|---|---|
#6 | interdiff.txt | 700 bytes | renatog |
#6 | 3350333-5.patch | 511 bytes | renatog |
array-filter-error.png | 509.24 KB | sujan shrestha |
Issue fork ckeditor5_font-3350333
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 #3
renatogThe solution proposed worked fine for me. Thanks for that - Marking as RTBC
This is the same fix of @maunm at #3307786-10: Error after installing CKEditor 5 - Font Plugin and as cited on this issue it's very importante so I'm updating the priority to "Major", ok?
Comment #4
renatogMy only suggestion in the code is to follow the S.O.L.I.D recommendation that says to avoid using the else clause
For example, instead of:
We can verify first if we don't have $colors and return array [] as a default. If pass on this verification we return the "normal" value. Example:
Comment #5
renatog'
Comment #6
renatogUpdated the MR with this suggestion from #4, and I'm also uploading a patch for
1.1.2-beta1
so if someone needs as a workaround can apply that using composerComment #7
Piotr Pakulskithank you @renatog patch 5 works great for me
Comment #8
chikeThe patch at #6 (patch 5) is working.
Comment #9
brad.bulger CreditAttribution: brad.bulger commentedshould that test on is_array() rather than empty()?
Comment #12
renatogthanks everyone
Comment #14
dbielke1986 CreditAttribution: dbielke1986 commentedIs there a chance to put this in a new release to get this module to a stable version?