diff --git a/core/modules/shortcut/src/Entity/ShortcutSet.php b/core/modules/shortcut/src/Entity/ShortcutSet.php
index 3d3815db79..4c14e6d659 100644
--- a/core/modules/shortcut/src/Entity/ShortcutSet.php
+++ b/core/modules/shortcut/src/Entity/ShortcutSet.php
@@ -117,6 +117,10 @@ public function resetLinkWeights() {
    */
   public function getShortcuts() {
     $shortcuts = \Drupal::entityManager()->getStorage('shortcut')->loadByProperties(['shortcut_set' => $this->id()]);
+    // Fixed according to http://shout.setfive.com/2013/06/14/symfony2-usort-array-was-modified-by-the-user-comparison-function/.
+    foreach ($shortcuts as $ab_weight) {
+      $nothing = $ab_weight->getWeight();
+    }
     uasort($shortcuts, ['\Drupal\shortcut\Entity\Shortcut', 'sort']);
     return $shortcuts;
   }
