jenkins-bot has submitted this change and it was merged.

Change subject: Fetch Storage from ManagerGroup every time
......................................................................


Fetch Storage from ManagerGroup every time

Caching the storage object internally breaks the ManagerGroup's
cached list of managers that have been used since the last
ManagerGroup::clear() operation.  Just call it directly each time.

Bug: T96388
Change-Id: Ia4782d553fa07c45518871ea74ccffd8cc93fdba
---
M includes/Collection/AbstractCollection.php
1 file changed, 3 insertions(+), 12 deletions(-)

Approvals:
  Sbisson: Looks good to me, but someone else must approve
  Matthias Mullie: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Collection/AbstractCollection.php 
b/includes/Collection/AbstractCollection.php
index 4db16dc..320af64 100644
--- a/includes/Collection/AbstractCollection.php
+++ b/includes/Collection/AbstractCollection.php
@@ -20,11 +20,6 @@
        protected $uuid;
 
        /**
-        * @var \Flow\Data\ObjectManager[]
-        */
-       protected $storage = array();
-
-       /**
         * Array of revisions for this object.
         *
         * @var AbstractRevision[]
@@ -100,13 +95,9 @@
                        $class = $this->getRevisionClass();
                }
 
-               if ( !isset( $this->storage[$class] ) ) {
-                       /** @var ManagerGroup $storage */
-                       $storage = Container::get( 'storage' );
-                       $this->storage[$class] = $storage->getStorage( $class );
-               }
-
-               return $this->storage[$class];
+               /** @var ManagerGroup $storage */
+               $storage = Container::get( 'storage' );
+               return $storage->getStorage( $class );
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/204683
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia4782d553fa07c45518871ea74ccffd8cc93fdba
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Sbisson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to