- 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
- 🇧🇷Brazil RenatoG Campinas
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?
- 🇧🇷Brazil RenatoG Campinas
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']); });
- 🇧🇷Brazil RenatoG Campinas
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 composer - 🇧🇷Brazil RenatoG Campinas
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 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
7 months ago 11:10pm 9 December 2023 Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
3 months 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?