- Affected version
- 2.2.8 Patch 1
XF\Mvc\Entity\Finder
implements __get
but not __isset
this interacts unexpectedly with the ??
operator.For objects, the
??
operator calls __isset()
first before calling __get
. This results in LogicException being thrown instead of the ??
operator working as expected.Something like this would preserve standard property testing and the relationship behavior (which doesn't appear to be used);
PHP:
public function __isset(string $key): bool
{
return property_exists($this, $key) || isset($this->structure->relations[$key]);
}
I ran into this when having add-on A extend a finder, that add-on B needs to interact with.
Last edited: