Icinga/icinga-notifications-web

Error when submitting incident search too fast: Method "getFilter" does not exist and was not trapped in __call()

Closed this issue · 2 comments

Steps to reproduce:

  1. Open incident list (/notifications/incidents)
  2. Type anything into the search bar and submit it very quickly. Quickly means hitting return before the "Search for *x* in: Host Name, Service Name" thing pops up.

This results in the following error/stack trace:

Method "getFilter" does not exist and was not trapped in __call()

#0 /usr/share/icingaweb2/library/Icinga/Web/Controller/ActionController.php(614): Zend_Controller_Action->__call()
#1 /usr/share/icingaweb2/modules/notifications/application/controllers/IncidentsController.php(47): Icinga\Web\Controller\ActionController->__call()
#2 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action.php(516): Icinga\Module\Notifications\Controllers\IncidentsController->indexAction()
#3 /usr/share/icingaweb2/library/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch()
#4 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Front.php(954): Icinga\Web\Controller\Dispatcher->dispatch()
#5 /usr/share/icingaweb2/library/Icinga/Application/Web.php(294): Zend_Controller_Front->dispatch()
#6 /usr/share/icingaweb2/library/Icinga/Application/webrouter.php(105): Icinga\Application\Web->dispatch()
#7 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#8 {main}

Versions: c5310ed in the current icinga/icingaweb2:master container.

That's because the code in controllers was mostly imported from Icinga DB Web without actually checking it all here and results in such errors.

if ($searchBar->hasBeenSubmitted()) {
$filter = $this->getFilter();

Icinga DB Web does have the getFilter() method defined in its own base controller, but IncidentsController and probably some of other controllers of this module directly extend CompatController that don't define the getFilter() method.

This has been fixed in #105.