From 59dacd34ad5e98f5967bc5a04c4a64513acdb634 Mon Sep 17 00:00:00 2001 From: mmaechler Date: Fri, 28 Mar 2014 10:03:27 +0100 Subject: [PATCH] #4 Bugfix: improved implementation --- module/Libadmin/src/Libadmin/Table/InstitutionTable.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/module/Libadmin/src/Libadmin/Table/InstitutionTable.php b/module/Libadmin/src/Libadmin/Table/InstitutionTable.php index 96e0cf1..6d4655b 100644 --- a/module/Libadmin/src/Libadmin/Table/InstitutionTable.php +++ b/module/Libadmin/src/Libadmin/Table/InstitutionTable.php @@ -186,9 +186,8 @@ private function relationsChanged(array $oldRelations, array $newRelations) { //Check the relations for equality foreach ( $oldRelations as $oldRelation ) { - $newRelation = $filteredNewRelations[$oldRelation->getPrimaryKey()]; - - if ( !$oldRelation->equals($newRelation) ) return true; + if ( !array_key_exists($oldRelation->getPrimaryKey(), $filteredNewRelations) ) return true; + if ( !$oldRelation->equals($filteredNewRelations[$oldRelation->getPrimaryKey()]) ) return true; } return false;