You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Eg. getAllSites, getSitesFromIds, getSiteFromId, ... pretty much all methods that return one or more sites and not only site ids.
What those methods do is the following:
PHP
$sites = array() // get sites in some way eg $this->getModel()->getAllSites()
Site::setSitesFromArray($sites);
return $sites;
It actually returns the raw site information as returned by the model / database but setSitesFromArray triggers a postEvent to let plugins change or extend the site information. As we do return only $sites and not the modified sites array the values might be incomplete.
Apart from this not making any sense it causes the site cache to be cleared which results in many more site queries although the site information was already fetched previously.
Ideally the site cache would not post an event as it is only a cache and should not contain any logic.
The text was updated successfully, but these errors were encountered:
tsteur
added
the
Bug
For errors / faults / flaws / inconsistencies etc.
label
Feb 9, 2015
Eg.
getAllSites
,getSitesFromIds
,getSiteFromId
, ... pretty much all methods that return one or more sites and not only site ids.What those methods do is the following:
It actually returns the raw site information as returned by the model / database but
setSitesFromArray
triggers apostEvent
to let plugins change or extend the site information. As we do return only$sites
and not the modified sites array the values might be incomplete.This sometimes results in weird code like this:
Apart from this not making any sense it causes the site cache to be cleared which results in many more site queries although the site information was already fetched previously.
Ideally the site cache would not post an event as it is only a cache and should not contain any logic.
The text was updated successfully, but these errors were encountered: