Loading core/lib/Drupal/Core/Menu/StaticMenuLinkOverrides.php +2 −1 Original line number Diff line number Diff line Loading @@ -71,9 +71,10 @@ public function reload() { * {@inheritdoc} */ public function loadOverride($id) { assert(is_string($id), 'Menu link plugin ID should be a string.'); $all_overrides = $this->getConfig()->get('definitions'); $id = static::encodeId($id); return $id && isset($all_overrides[$id]) ? $all_overrides[$id] : []; return $all_overrides[$id] ?? []; } /** Loading core/lib/Drupal/Core/Menu/StaticMenuLinkOverridesInterface.php +2 −2 Original line number Diff line number Diff line Loading @@ -21,14 +21,14 @@ public function reload(); * @param string $id * A menu link plugin ID. * * @return array|null * @return array * An override with following supported keys: * - parent * - weight * - menu_name * - expanded * - enabled * or NULL if there is no override for the given ID. * or an empty array if there is no override for the given ID. */ public function loadOverride($id); Loading core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php +0 −2 Original line number Diff line number Diff line Loading @@ -47,8 +47,6 @@ public function testLoadOverride($overrides, $id, $expected) { */ public function providerTestLoadOverride() { $data = []; // No specified ID. $data[] = [['test1' => ['parent' => 'test0']], NULL, []]; // Valid ID. $data[] = [['test1' => ['parent' => 'test0']], 'test1', ['parent' => 'test0']]; // Non existing ID. Loading Loading
core/lib/Drupal/Core/Menu/StaticMenuLinkOverrides.php +2 −1 Original line number Diff line number Diff line Loading @@ -71,9 +71,10 @@ public function reload() { * {@inheritdoc} */ public function loadOverride($id) { assert(is_string($id), 'Menu link plugin ID should be a string.'); $all_overrides = $this->getConfig()->get('definitions'); $id = static::encodeId($id); return $id && isset($all_overrides[$id]) ? $all_overrides[$id] : []; return $all_overrides[$id] ?? []; } /** Loading
core/lib/Drupal/Core/Menu/StaticMenuLinkOverridesInterface.php +2 −2 Original line number Diff line number Diff line Loading @@ -21,14 +21,14 @@ public function reload(); * @param string $id * A menu link plugin ID. * * @return array|null * @return array * An override with following supported keys: * - parent * - weight * - menu_name * - expanded * - enabled * or NULL if there is no override for the given ID. * or an empty array if there is no override for the given ID. */ public function loadOverride($id); Loading
core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php +0 −2 Original line number Diff line number Diff line Loading @@ -47,8 +47,6 @@ public function testLoadOverride($overrides, $id, $expected) { */ public function providerTestLoadOverride() { $data = []; // No specified ID. $data[] = [['test1' => ['parent' => 'test0']], NULL, []]; // Valid ID. $data[] = [['test1' => ['parent' => 'test0']], 'test1', ['parent' => 'test0']]; // Non existing ID. Loading