implode(): Argument #1 ($array) must be of type...

Search
Other Bug Reports questions
Forum

implode(): Argument #1 ($array) must be of type array, string given

Alex Booster's Avatar Alex Booster
Hi. I used 3 Calendar modules at one page.
If I log in to the site as an administrator, I see 3 calendars. if I log in as user 1, I get this error. user 1 has permission to view calendar 1 only
implode(): Argument #1 ($array) must be of type array, string given
If I delete calendars 2 and 3 modules from the page, user 1 sees the calendar. Calendar support did not find any errors in the calendar code

{module Calendar 1} - user1
{module Calendar 2} - user2
{module Calendar 3} - user3
Peter van Westen's Avatar Peter van Westen ADMIN
First, make sure your tags is correct and follows the syntax found here (so using attributes):
docs4.regularlabs.com/modulesanywhere/tu...how-to-use-it-syntax

Then switch on debug mode in your configuration to see the full error (and where it is coming from).
Please post a rating at the Joomla! Extensions Directory
Alex Booster's Avatar Alex Booster
{module Calendar 1}
{module Calendar 2}
{module Calendar 3}

{module title="Calendar 1"}
{module title="Calendar 2"}
{module title="Calendar 3"}

syntax is true
Call Stack
#
Function
Location
1
()
JROOT/modules/mod_dpcalendar_mini/tmpl/_scripts.php:51
2
implode()
JROOT/modules/mod_dpcalendar_mini/tmpl/_scripts.php:51
3
require()
JROOT/modules/mod_dpcalendar_mini/tmpl/default.php:22
4
require()
JROOT/libraries/src/Dispatcher/AbstractModuleDispatcher.php:87
5
Joomla\CMS\Dispatcher\AbstractModuleDispatcher::Joomla\CMS\Dispatcher\{closure}()
JROOT/libraries/src/Dispatcher/AbstractModuleDispatcher.php:90
6
Joomla\CMS\Dispatcher\AbstractModuleDispatcher->dispatch()
JROOT/libraries/src/Helper/ModuleHelper.php:289
7
Joomla\CMS\Helper\ModuleHelper::renderRawModule()
JROOT/libraries/src/Helper/ModuleHelper.php:160
8
Joomla\CMS\Helper\ModuleHelper::renderModule()
JROOT/libraries/src/Document/Renderer/Html/ModuleRenderer.php:99
9
Joomla\CMS\Document\Renderer\Html\ModuleRenderer->render()
JROOT/plugins/system/modulesanywhere/src/Replace.php:534
10
RegularLabs\Plugin\System\ModulesAnywhere\Replace::processModule()
JROOT/plugins/system/modulesanywhere/src/Replace.php:445
11
RegularLabs\Plugin\System\ModulesAnywhere\Replace::processMatch()
JROOT/plugins/system/modulesanywhere/src/Replace.php:642
12
RegularLabs\Plugin\System\ModulesAnywhere\Replace::replaceMatches()
JROOT/plugins/system/modulesanywhere/src/Replace.php:624
13
RegularLabs\Plugin\System\ModulesAnywhere\Replace::replace()
JROOT/plugins/system/modulesanywhere/src/Replace.php:72
14
RegularLabs\Plugin\System\ModulesAnywhere\Replace::processModules()
JROOT/plugins/system/modulesanywhere/modulesanywhere.php:76
15
PlgSystemModulesAnywhere->processArticle()
 
16
call_user_func_array()
JROOT/libraries/regularlabs/src/Article.php:210
17
RegularLabs\Library\Article::processText()
JROOT/libraries/regularlabs/src/Article.php:189
18
RegularLabs\Library\Article::process()
JROOT/libraries/regularlabs/src/SystemPlugin.php:202
19
RegularLabs\Library\SystemPlugin->onContentPrepare()
JROOT/libraries/src/Plugin/CMSPlugin.php:289
20
Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin\{closure}()
JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:454
21
Joomla\Event\Dispatcher->dispatch()
JROOT/components/com_content/src/View/Article/HtmlView.php:237
22
Joomla\Component\Content\Site\View\Article\HtmlView->display()
JROOT/libraries/src/MVC/Controller/BaseController.php:697
23
Joomla\CMS\MVC\Controller\BaseController->display()
JROOT/components/com_content/src/Controller/DisplayController.php:122
24
Joomla\Component\Content\Site\Controller\DisplayController->display()
JROOT/libraries/src/MVC/Controller/BaseController.php:730
25
Joomla\CMS\MVC\Controller\BaseController->execute()
JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:143
26
Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch()
JROOT/components/com_content/src/Dispatcher/Dispatcher.php:56
27
Joomla\Component\Content\Site\Dispatcher\Dispatcher->dispatch()
JROOT/libraries/src/Component/ComponentHelper.php:361
28
Joomla\CMS\Component\ComponentHelper::renderComponent()
JROOT/libraries/src/Application/SiteApplication.php:218
29
Joomla\CMS\Application\SiteApplication->dispatch()
JROOT/libraries/src/Application/SiteApplication.php:272
30
Joomla\CMS\Application\SiteApplication->doExecute()
JROOT/libraries/src/Application/CMSApplication.php:306
31
Joomla\CMS\Application\CMSApplication->execute()
JROOT/includes/app.php:58
32
require_once()
JROOT/index.php:32
Peter van Westen's Avatar Peter van Westen ADMIN
By the looks of it, the issue is in the mod_dpcalendar_mini module.
Please post a rating at the Joomla! Extensions Directory
Alex Booster's Avatar Alex Booster
that it only happens with advanced modules and not when rendered standalone.
Peter van Westen's Avatar Peter van Westen ADMIN
If they can't fix the code on their end, it means:
You cannot use that module via Modules Anywhere.
They are incompatible.
Please post a rating at the Joomla! Extensions Directory
Alex Booster's Avatar Alex Booster
but why does everything work with administrator access ?
Peter van Westen's Avatar Peter van Westen ADMIN
🤷‍♂️
Ask the developers of that module.
Please post a rating at the Joomla! Extensions Directory
Alex Booster's Avatar Alex Booster
ok, thank you
Alex Booster's Avatar Alex Booster
please check

Confidential information:
(hidden)
Alex Booster's Avatar Alex Booster
Calendar support said:
Look, the issue is that the parameters are not available in the module for some reasons. I can't fix that as this is the code from advanced module manager which renders them.
Peter van Westen's Avatar Peter van Westen ADMIN
It really is the job of the module (code inside it) to check for something if it wants to do something with it.
You can't just do an implode function on something unless you make sure it is an array first.
So this is down to (good) coding in the first place.

Why the data that that module gets is a string and not an array... I don't know. That may be something that could be looked into. But that requires full access to the files of the site to be able to trace where what data is coming from.

First step would be for the devs of dpcalendar to fix their code.
Please post a rating at the Joomla! Extensions Directory
Alex Booster's Avatar Alex Booster
Find a problem
In 2 modules out of ten on the page had the permission public, and user user-1 had the rights of a registered user. Therefore, there was no error with the admin rights. Thank you for your help.
Alex Booster's Avatar Alex Booster
A wish for the future is that access rights are visible in the admin panel as in the standard Joomla module manager. So that there is no need to disable the plugin or go into each module to check access rights. Thank you
Alex Booster's Avatar Alex Booster
P.S.
but, this looks for me clearly like a bug when it renders modules where the user has no permission for.
Peter van Westen's Avatar Peter van Westen ADMIN
Advanced Module Manager will NOT show modules where the access level does not match. This refers to the Access Level condition rule setting.
If you have been messing with the access level in the core module manager, while already using Advanced Module Manager, then yes, you can mess things up.
When you use Advanced Module Manager, use the condition rules. If you don't like how the conditions work, and would rather use the core access level and language assignments... Don't use Advanced Module Manager at all!
Please post a rating at the Joomla! Extensions Directory
Alex Booster's Avatar Alex Booster
Thank you, Peter.
These are just wishes for future releases. I like everything, I just have 100+ modules and it's hard to go to each one separately. Successes
You can only post on this forum if you log in