Skip to content

Commit

Permalink
Only pop from application stack if we successfully pushed.
Browse files Browse the repository at this point in the history
Fixed weird side-effects like loading hooks.php twice if reloading the topbar on Horde base pages.
  • Loading branch information
yunosh committed Aug 5, 2016
1 parent 413cd0c commit 3ddc937
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions horde/lib/Ajax/Application/Handler.php
Expand Up @@ -31,12 +31,14 @@ public function topbarUpdate()
{
global $injector, $registry;

$registry->pushApp($this->vars->app);
$pushed = $registry->pushApp($this->vars->app);
$topbar = $injector->getInstance('Horde_Core_Factory_Topbar')
->create('Horde_Tree_Renderer_Menu', array('nosession' => true));
$hash = $topbar->getHash();
$tree = $topbar->getTree();
$registry->popApp();
if ($pushed) {
$registry->popApp();
}

if ($this->vars->hash == $hash) {
return false;
Expand Down

0 comments on commit 3ddc937

Please sign in to comment.