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