-
Hey! Something strange happend for one of our admins.
(The error did not showed up for me but one of our admins experienced the problem)He tried to edit pages in our backend but a fatal error was caught.
[14-Jan-2023 15:28:47 UTC] PHP Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given in /home/u885534680/domains/beerballer.com/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/schema/class-blocks.php:71 Stack trace: #0 /home/u885534680/domains/beerballer.com/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/schema/class-blocks.php(71): array_merge() #1 /home/u885534680/domains/beerballer.com/public_html/wp-includes/class-wp-hook.php(310): RankMath\Schema\Blocks->block_categories() #2 /home/u885534680/domains/beerballer.com/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters() #3 /home/u885534680/domains/beerballer.com/public_html/wp-includes/block-editor.php(85): apply_filters() #4 /home/u885534680/domains/beerballer.com/public_html/wp-admin/edit-form-blocks.php(81): get_block_categories() #5 /home/u885534680/domains/beerballer.com/public_html/wp-admin/post.php(187): require('/home/u88553468...') #6 {main} thrown in /home/u885534680/domains/beerballer.com/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/schema/class-blocks.php on line 71Im not sure what is causing the error (because I could edit the pages as normal) but it seems so that $categories isn’t an array… Adding a small check before
is_array($categories) ? $categories : $categories = [];fixed my error. Not sure if that is the best option but would be happy if you could add a small check if $categories is an array before merging šThanks in advance!
Justus
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The ticket ‘Getting array_merge() error’ is closed to new replies.