By rbuelund on Friday, 06 November 2020
Replies 20
Likes 0
Views 636
Votes 0
Just updated to JEvens 3.6.8 and RSVP Pro 3.6 stable - I get this error when I try to enter JSVP Pro:

"Cannot use object of type Joomla\CMS\Toolbar\Button\StandardButton as array "

This on a Joomla 4 site.
Hey Ronnie, can you enable your Joomla debug and set the debug level to development so we can determine where this is happening?
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Here is the Call stack. Debug level = Maximum. There is no dev level in Joomla 4.

Call stack
# Function Location
1 () JROOT/libraries/src/Toolbar/Toolbar.php:345
2 Joomla\CMS\Toolbar\Toolbar->renderButton() JROOT/administrator/components/com_rsvppro/layouts/gslframework/header.php:145
3 include() JROOT/libraries/src/Layout/FileLayout.php:128
4 Joomla\CMS\Layout\FileLayout->render() JROOT/libraries/src/Layout/LayoutHelper.php:73
5 Joomla\CMS\Layout\LayoutHelper::render() JROOT/administrator/components/com_rsvppro/views/abstract/abstract.php:59
6 RSVPAbstractView->display() JROOT/administrator/components/com_rsvppro/controllers/params.php:78
7 AdminParamsController->edit() JROOT/libraries/src/MVC/Controller/BaseController.php:729
8 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_rsvppro/rsvppro.php:148
9 require_once() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:69
10 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
11 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:389
12 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:142
13 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:185
14 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:233
15 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/app.php:63
16 require_once() JROOT/administrator/index.php:36
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Not sure how this ever worked as this code hasn't changed in some time. On the other hand there is no layouts folder in the rsvp repo.

geraint can you take a look please? I suspect the layouts are being generated as part of the build process as they do not seem to be part of the repo so I cannot see any history in git to determine if there was a change here. The header layout is building the buttons and when it calls renderButton at line 145 the $toolbarButton at this point seems to be a string but an array is expected in the renderButton function.

Ronnie, as a quick test can you cast the $toolbarButton to an array at line 145 of administrator/components/com_rsvppro/layouts/gslframework/header.php just put (array) ahead of the var in the function call. See if that clears it up at least until Geraint can determine what really should be happening here.
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
If i change line 145 from:
$buttonoutput = $bar->renderButton($toolbarButton);

to
$buttonoutput = $bar->renderButton((array) $toolbarButton);

i get this error:

Cannot pass parameter 1 by reference

Call stack
# Function Location
1 () JROOT/administrator/components/com_rsvppro/layouts/gslframework/header.php:145
2 include() JROOT/libraries/src/Layout/FileLayout.php:128
3 Joomla\CMS\Layout\FileLayout->render() JROOT/libraries/src/Layout/LayoutHelper.php:73
4 Joomla\CMS\Layout\LayoutHelper::render() JROOT/administrator/components/com_rsvppro/views/abstract/abstract.php:59
5 RSVPAbstractView->display() JROOT/administrator/components/com_rsvppro/controllers/params.php:78
6 AdminParamsController->edit() JROOT/libraries/src/MVC/Controller/BaseController.php:729
7 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_rsvppro/rsvppro.php:148
8 require_once() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:69
9 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
10 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:389
11 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:142
12 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:185
13 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:233
14 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/app.php:63
15 require_once() JROOT/administrator/index.php:36
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
OK, so add a line immediately before it like this:

$tbButton = (array)$toolBarButton;

The change the var in the call to $tbButton

I don't guarantee this will work but I think worth a try.
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I have changed to this


foreach ($toolbarButtons as $toolbarButton)
{
$dbbutton = (array)$toolbarButton;
$buttonoutput = $bar->renderButton($dbbutton);
$buttonoutput = str_replace("btn ", "gsl-button gsl-button-primary ", $buttonoutput);
$buttonoutput = str_replace('class=""', "class='gsl-button gsl-button-primary' ", $buttonoutput);
$buttonoutput = str_replace(array("btn-small"), "", $buttonoutput);
echo $buttonoutput ;
}


and then get this error:

Argument 2 passed to Joomla\CMS\Toolbar\ContainerAwareToolbarFactory::createButton() must be of the type string, null given, called in /var/www/http://www.ableit-dev.dk/www/gasvaerket/libraries/src/Toolbar/Toolbar.php on line 375

Call stack
# Function Location
1 () JROOT/libraries/src/Toolbar/ContainerAwareToolbarFactory.php:40
2 Joomla\CMS\Toolbar\ContainerAwareToolbarFactory->createButton() JROOT/libraries/src/Toolbar/Toolbar.php:375
3 Joomla\CMS\Toolbar\Toolbar->loadButtonType() JROOT/libraries/src/Toolbar/Toolbar.php:347
4 Joomla\CMS\Toolbar\Toolbar->renderButton() JROOT/administrator/components/com_rsvppro/layouts/gslframework/header.php:146
5 include() JROOT/libraries/src/Layout/FileLayout.php:128
6 Joomla\CMS\Layout\FileLayout->render() JROOT/libraries/src/Layout/LayoutHelper.php:73
7 Joomla\CMS\Layout\LayoutHelper::render() JROOT/administrator/components/com_rsvppro/views/abstract/abstract.php:59
8 RSVPAbstractView->display() JROOT/administrator/components/com_rsvppro/controllers/params.php:78
9 AdminParamsController->edit() JROOT/libraries/src/MVC/Controller/BaseController.php:729
10 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_rsvppro/rsvppro.php:148
11 require_once() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:69
12 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
13 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:389
14 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:142
15 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:185
16 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:233
17 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/app.php:63
18 require_once() JROOT/administrator/index.php:36
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Well I was hoping for a quick and easy 'fix' to get you going but it seems not. Hopefully tonyp or geraint will have a look. It's weekend now so probably not until Monday.
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Well this bug is only on my Joomla 4 development site, all the Joomla 3 sites work with the version 3.6. But it would be nice to be able to get further on the Joomla 4 site ;-) Also - it seems that the club templates are not yet compatible with Joomla 4 . is that correct, and do we have an estimate on that ?
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I did some work with Geraint getting JEvents and RSVP J4 ready and it all seemed to work a few months ago, but I admit I did not test any of the other addons or templates so I can't really answer this. Hopefully the guys will come back to you on Monday, however, I do know Geraint is very busy trying to fix uikit issues and integration issues with other pieces of JEvents and RSVP so fixing a J4 bug right now may not be at the top of his list.
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
That is quite allright then :-)
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
rbuelund I'm looking into this today
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I can't recreate this issue - I'm wondering if you have a plugin that is generating additional toolbar items e.g. a general cache cleaner etc.
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I use Joomla 4 Beta 5 with default template, Only Akeeba Backup and Admin Tools installed - nothing else.
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Can we get super user access to review please?
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Details added in this post.
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Ronnie

Is there a backend access key/secret phrase I need too?
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Ahh yes - sorry. I have updated the details.
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
shoujld be working now - strange that it was ok on my server and not on yours!

Anyhow I replicated the code I use in JEvents and that works ok in J4
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Ok - thanks. Do you know when the club templates wil be compatible with J! 4 ?
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
they are very close - will hopefully release them all by the end of the week.
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post