Reputation: 223
I'm developing a backend component for Joomla and when I access certain views of my component the notice below gets logged. I'm currently running Joomla 3.5.1. Has anyone got the same notice?
PHP Notice: Undefined index: doTask in /var/www/html/layouts/joomla/toolbar/popup.php on line 14
Upvotes: 0
Views: 194
Reputation: 223
The reason for the notice was that I created a popup button like this:
$layout->render(array('name' => 'print', 'text' => JText::_('BUTTON_PRINT'), 'class' => 'icon-print'));
Adding doTask parameter fixed the problem and the notice is not showing anymore.
$layout->render(array('name' => 'print', 'doTask' => '', 'text' => JText::_('BUTTON_PRINT'), 'class' => 'icon-print'));
I looked at the popup.php file and after that it was pretty easy to figure out the cause. As you can see $doTask variable is used every time when a popup button is rendered.
<button value="<?php echo $doTask; ?>" class="btn btn-small modal" data-toggle="modal" data-target="#modal-<?php echo $name; ?>">
Upvotes: 1