After installing comment 1.2 on my J5.4 site, my site crashed and the following error appeared:
0array_merge(): Argument #1 must be of type array; null is provided.
What could be happening?
Thanksyou
Latest post by Lefteris Kavadas on Monday, 01 December 2025 12:27 EET
Hi Carlos,
Thank you for your message.
To better understand the issue, could you please share more details?
Please also enable Joomla Debug and Error Reporting → Maximum so you can get the full stack trace. This will help identify exactly where the array_merge(): Argument #1 must be of type array; null is provided error is coming from.
Once you have the detailed error message, please paste it here and I’ll help you resolve it right away.
Kind regards,
Lefteris
Hi Carlos,
Thank you for the update.
I just tested CommentBox 1.2.0 on a clean Joomla 5.4.0 installation and couldn’t reproduce the issue, so it seems that something in the environment is returning a null value where Joomla normally provides an array. CommentBox expects an array in that part of the code, and another plugin modifying the content pipeline can cause this.
We will add a safety check in the next CommentBox release to prevent this error from appearing even when another extension returns invalid data. However, the underlying cause is most likely a third-party plugin that isn’t fully compatible with Joomla 5.4.
To identify the source, please try the following:
Let me know which plugin is responsible once you locate it, and I’ll be happy to help you resolve it.
Kind regards,
Lefteris
Hi Carlos,
Thank you for the detailed follow-up — that information is really helpful.
Based on everything you’ve tried, I agree that this is very likely caused by stale data or behavior left over from an older Joomla / extension setup. In Joomla 5.4, the onContentBeforeDisplay event is expected to return an array, but in your case it’s coming back as null, which causes array_merge() to fail.
You can safely fix this by adjusting one line in CommentBox so it defensively casts the value to an array.
Please edit the following file:
plugins/content/commentbox/src/Extension/CommentBox.php
At line 182, replace the existing line with this:
$event->setArgument('result', array_merge((array) $event->getArgument('result'), [$html]));
This ensures that even if another plugin (or legacy data) returns null, CommentBox will continue to work correctly.
I will include this safeguard in the next CommentBox release, so no manual change will be needed going forward.
After applying the change:
Please let me know if this resolves the issue on both sites.
Thank you again for your patience and for the thorough debugging — I really appreciate it.
Kind regards,
Lefteris
Hi Carlos,
That’s excellent to hear — I’m really glad it worked on both sites!
Thank you very much for your kind words and for taking the time to leave a rating on the JED. It’s truly appreciated and helps a lot in supporting and improving the extension.
If you have any questions in the future or need assistance with CommentBox, feel free to get in touch anytime.
Best regards,
Lefteris
Note: An active subscription is required in order to get support for our paid extensions. For our free extensions, if you don't have an account, register and then submit your support request. In case you just want to ask a question, you can also use the contact form .