Problem/Motivation

Steps to reproduce

  1. On a Standard installation go to Add content » Article and fill in a title
  2. Click the Provide a menu link checkbox in the Menu settings details (in the sidebar).
  3. Click Preview on the bottom of the page.

Expected result

You see a preview of the node (with or without a menu link).

Actual result

Drupal\Core\Entity\EntityStorageException: The entity URI "entity:node/" is invalid. You must specify the entity id in the URL. e.g., entity:node/1 for loading the canonical path to node entity with id 1. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 929 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal\Core\Url::fromUri('entity:node/')

  • Drupal\link\Plugin\Field\FieldType\LinkItem->getUrl()
  • Drupal\menu_link_content\Entity\MenuLinkContent->getUrlObject()
  • Drupal\menu_link_content\Entity\MenuLinkContent->getPluginDefinition()
  • Drupal\menu_link_content\Entity\MenuLinkContent->postSave(Object, )
  • Drupal\Core\Entity\EntityStorageBase->save(Object)
  • Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object)
  • Drupal\Core\Entity\Entity->save()
  • _menu_ui_node_save(Object, Array)
  • menu_ui_form_node_form_submit(Array, Object)
  • call_user_func_array('menu_ui_form_node_form_submit', Array)
  • Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object)
  • Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object)
  • Drupal\Core\Form\FormBuilder->processForm('node_article_form', Array, Object)
  • Drupal\Core\Form\FormBuilder->buildForm(Object, Object)
  • Drupal\Core\Entity\EntityFormBuilder->getForm(Object)
  • Drupal\node\Controller\NodeController->add(Object)

...

Proposed resolution

Remaining tasks

User interface changes

API changes

Comments

tstoeckler’s picture

Issue summary: View changes
xjm’s picture

Priority: Critical » Major

Per https://www.drupal.org/core/issue-priority#critical-bug, critical bugs are those that:

  • Render a system unusable and have no workaround.
  • Cause loss of data.
  • Expose security vulnerabilities.
  • Cause tests to fail in HEAD on the automated testing platform, since this blocks all other work.

This does not render Drupal (or the node system) unusable, and I guess the workarounds would be to enter the menu after previewing or saving. Nasty though, so definitely a major bug. Thanks @tstoeckler for finding this!

tstoeckler’s picture

Wow, sorry but this is really getting ridiculous. I won't play priority ping pong, but if this is not critical, then we might as well just release 8.0.0 today. Please name one critical that makes Drupal more unusable than this.

webwarrior’s picture

Status: Active » Needs review
StatusFileSize
new691 bytes

Possible solution.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Works for me, thanks!

webchick’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Let's get some tests to ensure this doesn't happen again.

googletorp’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new871 bytes
new1.53 KB

Added a test case for this.

Fails without the patch and passes with the patch from #4.

tstoeckler’s picture

StatusFileSize
new871 bytes

Uploading a tests-only patch.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.53 KB

And the original patch again, so it's the last one.

Marking RTBC, assuming the tests come back red and green as expected.

Thanks @googletorp for adding the test!

The last submitted patch, 8: menu-ui-preview-2475805-7--tests-only.patch, failed testing.

xjm’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the test-only patch to expose the failure. This issue addresses a major bug and is prioritized per https://www.drupal.org/core/beta-changes. Committed and pushed to 8.0.x.

Removed an non-standard comma on commit:

-    // Test that we can preview a node, that will create a menu item.
+    // Test that we can preview a node that will create a menu item.

  • xjm committed d0ac105 on 8.0.x
    Issue #2475805 by tstoeckler, googletorp, webwarrior:...

Status: Fixed » Closed (fixed)

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