- Issue created by @sujan shrestha
- Merge request !1Issue #3350333: TypeError: array_filter(): Argument #1 ($array) must be of type array โ (Merged) created by Unnamed author
The solution proposed worked fine for me. Thanks for that
Marking as RTBC
This is the same fix as #3307786-10: Error after installing CKEditor 5 - Font Plugin โ and since it's important as cited on this issue above I'm updating the priority to "Major", ok?
My 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:
if(is_array($colors)) { return array_filter($colors, function ($clr) { return preg_match('/^#(?:[0-9a-f]{3}){1,2}$/i', $clr['color']); }); } else { return []; }
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:
if (empty($colors)) return []; return array_filter($colors, function ($clr) { return preg_match('/^#(?:[0-9a-f]{3}){1,2}$/i', $clr['color']); });
Updated 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 composerUpdated 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 composer- ๐ต๐ฑPoland piotr pakulski Poland ๐ช๐บ
thank you @renatog patch 5 works great for me
- ๐บ๐ธUnited States brad.bulger
should that test on is_array() rather than empty()?
-
devicious โ
committed 0eb37885 on 1.x authored by
sujan shrestha โ
Issue #3350333: TypeError: array_filter(): Argument #1 ($array) must be...
-
devicious โ
committed 0eb37885 on 1.x authored by
sujan shrestha โ
- Status changed to Fixed
almost 2 years ago 11:10pm 9 December 2023 Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
over 1 year ago 9:13am 14 March 2024 - ๐ฉ๐ชGermany dbielke1986
Is there a chance to put this in a new release to get this module to a stable version?