Problem/Motivation

This is a regression from the combination of #3212105: Class values in menu link submit hook are appended instead of replaced and #3196822: Menu link attributes seems to break menu item translation that are in 8.x-1.3-rc1.
- When saving the default translation with NEW link attributes, the link attributes will not save.
- The following warning is thrown:

Warning: Undefined variable $menu_link_attributes in menu_link_attributes_menu_link_content_form_entity_builder() (line 190 of modules/contrib/menu_link_attributes/menu_link_attributes.module).
CommentFileSizeAuthor
#2 menu_link_attributes-3312369-2.patch962 bytesrecrit

Comments

recrit created an issue. See original summary.

recrit’s picture

Status: Active » Needs review
StatusFileSize
new962 bytes

The attached patch ensures that the $menu_link_options variable is set to either $menu_link_attributes (updated values on the default translation) or $menu_link_options, (the original values). The $menu_link_options variable needs to be correct / in sync with the other items options setting since it will be used on all other translations.

jcnventura’s picture

Thanks for catching that. Ideally we should have tests. I just need to do a simple change to your code, and I'll commit this.

  • 1259a0f committed on 8.x-1.x
    Issue #3312369 by recrit, jcnventura: Attributes do not save on the...
jcnventura’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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