Currently <front> is replaced with '' causing the user to add for each time the menu config link is edited.

This is because of the conditional that sets the default value

    elseif ($url->getRouteName() == '<front>') {
      // The default route for new entities is <front>, but we just want an
      // empty form field.
      $default_value = '';
    }

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

grndlvl created an issue. See original summary.

grndlvl’s picture

I was able to resolve this within the conditional, however, I wonder why we are returning '' for any route name via getRouteName()... this seems like a mistake and we might want to adjust how we are creating the URL object via getUrlObject()?

In the interest of time I resolved on the issue within the form.

Status: Needs review » Needs work

The last submitted patch, 2: 2687913-1-config_menu_link-front-default-value.patch, failed testing.

The last submitted patch, 2: 2687913-1-config_menu_link-front-default-value.patch, failed testing.

labboy0276’s picture

Status: Needs work » Fixed

Patch applied, thank you

Status: Fixed » Closed (fixed)

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