[Tickets #10017] Re: applications are incorrectly "polled" even if they are not installed
bugs at horde.org
bugs at horde.org
Fri May 6 17:09:28 UTC 2011
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/10017
------------------------------------------------------------------------------
Ticket | 10017
Updated By | Michael Slusarz <slusarz at horde.org>
Summary | applications are incorrectly "polled" even if they are
| not installed
Queue | Horde Framework Packages
Version | Git master
Type | Bug
State | Not A Bug
Priority | 1. Low
Milestone |
Patch |
Owners |
------------------------------------------------------------------------------
Michael Slusarz <slusarz at horde.org> (2011-05-06 17:09) wrote:
> Correct me if I'm wrong but this code always marks 'heading' and
> 'sidebar' applications as active, no?
>
> } elseif ($app['status'] == 'heading' ||
> $app['status'] == 'sidebar') {
> continue;
> }
Yes - that is correct.
But again, this should not matter. Because in the sidebar generation
code, this happens:
case 'sidebar':
try {
$registry->callAppMethod($params['app'],
'sidebarCreate', array('args' => array($this->_tree,
empty($params['menu_parent']) ? null : $params['menu_parent'],
isset($params['sidebar_params']) ? $params['sidebar_params'] :
array())));
} catch (Horde_Exception $e) {
if ($e->getCode() != Horde_Registry::NOT_ACTIVE) {
Horde::logMessage($e, 'ERR');
}
}
callAppMethod() should immediately fail because the application
($params['app']) is not active.
It is debatable whether we could optimize this check more. Right now,
the code is very clean, since all application existence checking takes
place inside of the Registry object. Conversely, Jan has shown in the
past that throwing/catching Exceptions is not the most efficient of
operations. So there is a trade-off between nice OO-coding style with
performance here. However, for purposes of analyzing this current
issue, this is irrelevant.
Back to the analysis... when callAppMethod() throws an Exception, we
check to see if the exception is that the application does not exist.
If that is the error, then we ignore the exception and continuing
processing the next sidebar block. And this is what happens on my
installation.
So once again, the question remains: why is this Exception returning
something other than Horde_Registry::NOT_ACTIVE for you? Because this
is what is broken, not anything dealing with marking 'sidebar'
registry blocks active or inactive.
More information about the bugs
mailing list