diff --git a/lang/en.yml b/lang/en.yml index 02182e48e..f03d3ab86 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -7,7 +7,7 @@ en: EDITINFO: 'Edit this file' REMOVE: Remove SilverStripe\Control\ChangePasswordEmail_ss: - CHANGEPASSWORDFOREMAIL: 'The password for account with email address {email} has been changed. If you didn\''t change your password please change your password using the link below' + CHANGEPASSWORDFOREMAIL: "The password for account with email address {email} has been changed. If you didn't change your password please change your password using the link below" CHANGEPASSWORDTEXT1: 'You changed your password for' CHANGEPASSWORDTEXT3: 'Change password' HELLO: Hi diff --git a/src/Core/CustomMethods.php b/src/Core/CustomMethods.php index 09f906eca..475dd99f6 100644 --- a/src/Core/CustomMethods.php +++ b/src/Core/CustomMethods.php @@ -285,12 +285,10 @@ trait CustomMethods $methodInfo = self::$extra_methods[$class][$method]; - if ( - // always check for property - (isset($methodInfo['property']) && $methodInfo['property'] === $property) && - // check for index only if provided - (!$index || ($index && isset($methodInfo['index']) && $methodInfo['index'] === $index)) - ) { + // always check for property, AND + // check for index only if provided + if ((isset($methodInfo['property']) && $methodInfo['property'] === $property) && + (!$index || ($index && isset($methodInfo['index']) && $methodInfo['index'] === $index))) { unset(self::$extra_methods[$class][$method]); } } diff --git a/src/ORM/RelatedData/StandardRelatedDataService.php b/src/ORM/RelatedData/StandardRelatedDataService.php index 4671e8156..d3733774b 100644 --- a/src/ORM/RelatedData/StandardRelatedDataService.php +++ b/src/ORM/RelatedData/StandardRelatedDataService.php @@ -179,14 +179,11 @@ class StandardRelatedDataService implements RelatedDataService $class = get_class($record); foreach ($record->manyMany() as $component => $componentClass) { $componentClass = $this->updateComponentClass($componentClass, $throughClasses); - if ( - // Ignore belongs_many_many_through with dot syntax - strpos($componentClass, '.') !== false || - // Prevent duplicate counting of self-referential relations e.g. - // MyFile::$many_many = [ 'MyFile' => MyFile::class ] - // This relation will still be counted in $this::addRelatedReverseManyManys() - $record instanceof $componentClass - ) { + // Ignore belongs_many_many_through with dot syntax, AND + // Prevent duplicate counting of self-referential relations e.g. + // MyFile::$many_many = [ 'MyFile' => MyFile::class ] + // This relation will still be counted in $this::addRelatedReverseManyManys() + if (strpos($componentClass, '.') !== false || $record instanceof $componentClass) { continue; } $results = $this->fetchManyManyResults($record, $class, $component, false);