Problem/Motivation

When running database updates "taxonomy_menu_ui_update_9001", when trying to update a menu link content entity that is part of a menu that has been removed, the update fails with the error:

 [error]  SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'bundle' cannot be null: UPDATE "menu_link_content" SET "revision_id"=:db_update_placeholder_0, "bundle"=:db_update_placeholder_1, "uuid"=:db_update_placeholder_2, "langcode"=:db_update_placeholder_3
> WHERE "id" = :db_condition_placeholder_0; Array
> (
>     [:db_update_placeholder_0] => 1234
>     [:db_update_placeholder_1] => 
>     [:db_update_placeholder_2] => xxxxxx-xxxx-xxxx-xxxxx-xxxx
>     [:db_update_placeholder_3] => en
>     [:db_condition_placeholder_0] => 123456
> )
>  

Steps to reproduce

Honestly, not sure how we got here but my best guess is that these menu items were part of a menu that has gotten deleted.

Proposed resolution

Check that the menu name value is not empty prior to update.

Remaining tasks

X Issue Fork
_ Test Update
_ Merge Code

User interface changes

None

API changes

None

Data model changes

None

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

scott_earnest created an issue. See original summary.

scott_earnest’s picture

Issue summary: View changes
scott_earnest’s picture

Assigned: scott_earnest » Unassigned
Status: Active » Needs review

Testing steps:

  • create an orphaned menu item, by deleting it's parent
  • ensure you can reproduce the error/issue prior to patching
  • apply patch
  • run module database updates taxonomy_menu_ui_update_9001
  • ensure the updates run successfully without error

This is ready for review please and thank you.

lobodakyrylo’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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