Fixed bug in GroupMembershipResolver, objects not stored to instance if loading all objects causing mappings to not be stored.

This commit is contained in:
Gregory Hargreaves 2018-10-20 14:46:00 +01:00 committed by Thomas Gelf
parent 2efd90302c
commit fcd4125d71

View File

@ -85,7 +85,6 @@ abstract class GroupMembershipResolver
$this->recheckAllObjects($this->getAppliedGroups());
if (empty($this->objects)) {
Benchmark::measure('Nothing to check, got no qualified object');
return $this;
}
@ -509,11 +508,11 @@ abstract class GroupMembershipResolver
$staticGroups = [];
if ($this->objects === null) {
$objects = $this->fetchAllObjects();
} else {
$objects = & $this->objects;
$this->objects = $this->fetchAllObjects();
}
$objects = & $this->objects;
$times = array();
foreach ($objects as $object) {
@ -527,7 +526,6 @@ abstract class GroupMembershipResolver
$mt = microtime(true);
$id = $object->get('id');
// TODO: fix this last hard host dependency
DynamicApplyMatches::setType($this->type);
$resolver = DynamicApplyMatches::prepare($object);
foreach ($groups as $groupId => $filter) {
@ -535,7 +533,6 @@ abstract class GroupMembershipResolver
if (! array_key_exists($groupId, $mappings)) {
$mappings[$groupId] = [];
}
$mappings[$groupId][$id] = $id;
}
}