Problem/Motivation

Controller override the defalut behaviour of setting of bundle field value of menu_link_content entity.

Proposed resolution

Remove related row.

Remaining tasks

  1. Remove related row.
  2. Replace usage entityManager by entityTypeManager in controller.

User interface changes

No changes. Bundle field value predefined in Drupal\menu_link_content\Entity\MenuLinkContent::preCreate(); method. So the user will see the same entity create form.

API changes

No changes.

Data model changes

No changes.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

voleger created an issue. See original summary.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Wim Leers’s picture

Category: Feature request » Task
Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/menu_link_content/src/Controller/MenuController.php
@@ -20,12 +20,13 @@ class MenuController extends ControllerBase {
+        'id' => '',
+        'parent' => '',

If we're cleaning this up I think we can we also remove these too? I'm not sure what use they are the parent and id don't need to be empty strings to create a menu link.

Dinesh18’s picture

Status: Needs work » Needs review
FileSize
647 bytes
921 bytes

I agree with @alexpott, we should clean the parent and id as well.
Here is the updated patch and interdiff.txt

voleger’s picture

Status: Needs review » Reviewed & tested by the community

Tests pass and the patch looks good to me.
+1 for RTBC

alexpott’s picture

Version: 8.5.x-dev » 8.7.x-dev
Status: Reviewed & tested by the community » Fixed

Committed 4ee92a7 and pushed to 8.7.x. Thanks!

As a task only committed to 8.7.x

  • alexpott committed 4ee92a7 on 8.7.x
    Issue #2923429 by Dinesh18, voleger, alexpott: Remove 'bundle' key from...

Status: Fixed » Closed (fixed)

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