#1454 Posted in ‘CommentBox’

Latest post by Lefteris Kavadas on Monday, 01 December 2025 12:27 EET

carlosdel1
Hello
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

Lefteris Kavadas

Hi Carlos,

Thank you for your message.

To better understand the issue, could you please share more details?

  • Which specific page or action triggers the crash?
  • Does it happen in the frontend, backend, or both?

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

carlosdel1
The error is present on all pages of the frontend. It doesn't occur in the admin panel.
Now I'm getting this message:
 0 array_merge(): Argument #1 must be of type array, null given 

carlosdel1
I was using the GK blank template. I switched to the Casiopea template, which now shows me the following: 



#
Function
Location




1
()
JROOT/plugins/content/commentbox/src/Extension/CommentBox.php:182


2
array_merge()
JROOT/plugins/content/commentbox/src/Extension/CommentBox.php:182


3
Firecoders\Plugin\Content\CommentBox\Extension\CommentBox->onContentBeforeDisplay()
JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:454


4
Joomla\Event\Dispatcher->dispatch()
JROOT/components/com_content/src/View/Article/HtmlView.php:251


5
Joomla\Component\Content\Site\View\Article\HtmlView->display()
JROOT/libraries/src/MVC/Controller/BaseController.php:697


6
Joomla\CMS\MVC\Controller\BaseController->display()
JROOT/components/com_content/src/Controller/DisplayController.php:122


7
Joomla\Component\Content\Site\Controller\DisplayController->display()
JROOT/libraries/src/MVC/Controller/BaseController.php:730


8
Joomla\CMS\MVC\Controller\BaseController->execute()
JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:143


9
Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch()
JROOT/components/com_content/src/Dispatcher/Dispatcher.php:56


10
Joomla\Component\Content\Site\Dispatcher\Dispatcher->dispatch()
JROOT/libraries/src/Component/ComponentHelper.php:361


11
Joomla\CMS\Component\ComponentHelper::renderComponent()
JROOT/libraries/src/Application/SiteApplication.php:217


12
Joomla\CMS\Application\SiteApplication->dispatch()
JROOT/libraries/src/Application/SiteApplication.php:271


13
Joomla\CMS\Application\SiteApplication->doExecute()
JROOT/libraries/src/Application/CMSApplication.php:304


14
Joomla\CMS\Application\CMSApplication->execute()
JROOT/includes/app.php:58


15
require_once()
JROOT/index.php:51



 

Lefteris Kavadas

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:

  1. Update all third-party extensions to their latest versions to ensure Joomla 5.4 compatibility.
  2. If the problem persists, disable content-related plugins one by one (especially “Content”-type plugins) and test the frontend after each change. This will help locate the plugin returning a null value.
  3. Once we know which plugin is causing it, I can advise you further or provide a workaround. 

Let me know which plugin is responsible once you locate it, and I’ll be happy to help you resolve it.

Kind regards,
Lefteris

carlosdel1
Hello. I updated and then deactivated all third-party plugins and modules, but I'm still getting the error. I also tried replacing the Joomla files with the latest version. I think it might be due to a leftover from an old plugin or component installation, since I've been updating this site for years, starting with J2.5. Another sister site is having the same problem.It seems I'll have to wait for a component update to see if it works. Best regards.

carlosdel1
I uninstalled all non-Joomla components, plugins, and modules. I went to phpMyAdmin and optimized and repaired the tables, but I couldn't fix the error. I'm open to any ideas that might help solve this.Thank you very much.

Lefteris Kavadas

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.

Temporary workaround (safe to apply)

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.

Permanent fix

I will include this safeguard in the next CommentBox release, so no manual change will be needed going forward.

After applying the change:

  • Clear Joomla and browser caches
  • Reload the frontend

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

carlosdel1
Hi Lefteris, it worked perfectly on both sites. Thank you so much for your help and for the essential component that Joomla needed. I'll leave you a rating on Joomla's JED.
Regards

Lefteris Kavadas

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 .

Firecoders
Are you using our extensions? Please post a review at the Joomla extensions directory!
Post a review