Closed (fixed)
Project:
Crumbs, the Breadcrumbs suite
Version:
7.x-2.0-beta19
Component:
Crumbs Plugins
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
19 Aug 2014 at 08:43 UTC
Updated:
22 Sep 2014 at 17:20 UTC
Jump to comment: Most recent
Comments
Comment #1
donquixote commentedWhich PHP version?
Comment #2
proxima8 commented5.3.8-2
Comment #3
proxima8 commentedYet beta16, 15 and 14 make the same error to
Comment #4
donquixote commentedHi!
Sorry, I was quite busy today with client work.
The place to debug this is the class crumbs_PluginSystem_PluginMethodIterator.
As a typical iterator, this class has a current() method and a valid() method.
The current() method returns the value of the foreach(). If the valid() method returns FALSE, the loop stops.
Looking at the code, it seems as if the current() method should always return an object, if the valid() method previously returned TRUE.
Btw one of the docblock comments in PluginEngine is wrong, it should be
So the $position is not a PluginMethodIterator, but a PluginMethodIteratorPosition.
But this docblock is not the cause of the error, obviously.
Comment #5
donquixote commentedOf course we could make the valid() method more solid, like this:
But it would be weird if $this->pluginKey is not NULL, while $this->iteratorPosition is NULL.
Comment #6
lpedretti commentedI just prepended if (!is_object($position)) continue;
The error appeared to me after i disabled the '*' plugin.
Comment #7
donquixote commentedFixed with http://cgit.drupalcode.org/crumbs/commit/?id=c1fcedb84f2a000e30dc62d0370...
This should really fix the issue, but it does not really explain what goes wrong in the iterator.
I thought for a moment that it is the confusion of FALSE vs NULL in crumbs_PluginSystem_PluginMethodIterator::setFirstValidIteratorPosition(). But this really can't be it. Whenever the pluginKey is something other than NULL, the iteratorPosition will be an object.