diff --git a/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php b/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php index 3c48892..af9f14d 100644 --- a/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php +++ b/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php @@ -87,6 +87,11 @@ protected function initializePlugin($instance_id) { * @return $this */ public function sort() { + // Iterate to force lazy loading so uasort doesn't trigger changes + // that cause "Array was modified" warning. + foreach($this->instanceIDs as $id){ + $this->get($id)->getPluginId(); + } uasort($this->instanceIDs, [$this, 'sortHelper']); return $this; }