To reproduce:

  • Clone the latest HEAD
  • Hit admin/config/user-interface/shortcut/manage/default/add-link
  • Give your shortcut a name but do NOT enter any custom path
  • Hit Save
  • Re-order your newly created shortcut
  • Hit Save Changes

You should now be getting the below failure:

Drupal\Core\Entity\EntityStorageException: No matching route could be found for the path "" in Drupal\Core\Entity\ContentEntityDatabaseStorage->save() (line 623 of core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php).

Comments

Anonymous’s picture

Title: Reordering a shortcut when no path is defined fails with an error » Saving a shortcut set with empty or <front> link fails with an error

After playing around with this for a bit, I think the issue has more to it than described in the initial post. Failed saving after reordering seems to be a side effect. The reproduction steps are valid, but the reordering is unneeded.

Any link with an empty path "" or the frontpage path "<front>" causes the shortcut set overview page to fail when saving all links using the "Save changes" button.
In shortcut_valid_link() a comment states that empty and front page links are valid for shortcuts. But when saving the list page, Url::createFromPath() is called and tries to resolve the "empty" link which off course fails.

When using "<front>" as path, a similar issue occurs. It seems like the "<front>" link is not properly read from the database, and becomes an empty string when evaluating the shortcut. I'm not sure if this should be a seperate issue though.

Wim Leers’s picture

Anonymous’s picture

@Wim Leers: your link points to this page. Could you correct it?

Wim Leers’s picture

Hah, oops!

I meant to link to #2235457: Use link field for shortcut entity — sorry!

Wim Leers’s picture

Status: Active » Postponed

At the very least, this is postponed on #2235457: Use link field for shortcut entity. Once that lands, we should verify that it's indeed fixed, and if so, close this issue.

Anonymous’s picture

Status: Postponed » Needs review

Adding an empty path is no long possible, since the validation stops that. Using now works as expected by linking to the homepage.

If someone can verify this, we can close the issue.

dawehner’s picture

Status: Needs review » Fixed

Quickly manually tested it and it seemed alright for me. Awesome.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.