Commit 30ea03aa authored by Angie Byron's avatar Angie Byron
Browse files

Issue #1926958 by amateescu, maciej.zgadzaj, dawehner: Fixed (Regression)...

Issue #1926958 by amateescu, maciej.zgadzaj, dawehner: Fixed (Regression) menu_link_save() no longer returns success/failure to calling functions.
parent a28d09eb
......@@ -82,7 +82,10 @@ function testMenu() {
// Verify that a change to the description is saved.
$description = $this->randomName(16);
$item['options']['attributes']['title'] = $description;
$return_value = menu_link_save($item);
// Save the menu link again to test the return value of the procedural save
// helper.
$this->assertIdentical($return_value, $item->save(), 'Return value of menu_link_save() is identical to the return value of $menu_link->save().');
$saved_item = entity_load('menu_link', $item['mlid']);
$this->assertEqual($description, $saved_item['options']['attributes']['title'], 'Saving an existing link updates the description (title attribute)');
$this->resetMenuLink($item, $old_title);
......@@ -115,9 +115,13 @@ function menu_link_delete_multiple(array $mlids, $force = FALSE, $prevent_repare
* @param \Drupal\menu_link\Plugin\Core\Entity\MenuLink $menu_link
* The menu link entity to be saved.
* @return int|bool
* Returns SAVED_NEW or SAVED_UPDATED if the save operation succeeded, or
* FALSE if it failed.
function menu_link_save(MenuLink $menu_link) {
return $menu_link->save();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment