- ๐ฎ๐ณIndia nikhil_110
Attached patch against Drupal 10.1.x
Patch #15 is not applied for Drupal 10.1.x so Inter-diff file is not added.Checking patch core/modules/menu_ui/src/MenuForm.php... Hunk #1 succeeded at 234 (offset 14 lines). error: while searching for: ]), ]); $links = $this->buildOverviewTreeForm($tree, $delta); foreach (Element::children($links) as $id) { if (isset($links[$id]['#item'])) { $element = $links[$id]; error: patch failed: core/modules/menu_ui/src/MenuForm.php:273 error: core/modules/menu_ui/src/MenuForm.php: patch does not apply Checking patch core/modules/user/src/Plugin/Menu/LoginLogoutMenuLink.php... Checking patch core/modules/user/src/Plugin/Menu/UserPageMenuLink.php... Checking patch core/modules/user/tests/src/Functional/UserAccountLinksTest.php... error: while searching for: // auto-increment is 1. Use XPath to obtain input element id and name using // the consistent label text. $this->drupalGet('admin/structure/menu/manage/account'); $label = $this->xpath('//label[contains(.,:text)]/@for', [':text' => 'Enable My account menu link']); $this->assertFieldChecked($label[0]->getText(), "The 'My account' link is enabled by default."); // Disable the 'My account' link. error: patch failed: core/modules/user/tests/src/Functional/UserAccountLinksTest.php:88 error: core/modules/user/tests/src/Functional/UserAccountLinksTest.php: patch does not apply
- last update
almost 2 years ago 29,361 pass - First commit to issue fork.
- First commit to issue fork.
- @mrinalini9 opened merge request.
- ๐ฎ๐ณIndia mrinalini9 New Delhi
Created MR for the patch changes in #27 for the 11.x branch, please review it.
Thanks!
- ๐บ๐ธUnited States smustgrave
@mrinalini9 please donโt take patches and just turn to MRs without checking.
fix should use constructor promotion and type hints for and thatโs just from 5 second glance.
Also please read the comments and tags. This was tagged for issue summary which still hasnโt happened
Thanks
- ๐จ๐ฆCanada sebish
We were working with colleagues on that issue and we would like to propose an alternative approach. The current patch is adding the description inside the link itself and we do not think it's the best approach.
What about if we use the metadata property already available in the MenuLinkFieldDefinitions.php ?
We could have user.link.menu.yml looking like:user.page: title: 'My account' weight: -10 route_name: user.page menu_name: account metadata: suffix: '(logged in users only)'
Then in the MenuForm.php, we could get the suffix property of metadata. That way, any contrib or custom module could do it the same way to display the message they want beside the menu link.
Something like this in MenuForm.php:
if ( isset($link->getMetaData()['suffix']) ) { $suffix = $link->getMetaData()['suffix']; }
I'd be happy to provide with a patch if you think that's helping.
- ๐จ๐ฆCanada jigarius Montrรฉal
The idea in #34 seems interesting and the description could in fact be put under the "metadata" key. However, the "metadata" property doesn't seem to have a clear description or definition of purpose. It would be good to know what that property is expected to be used for before making a decision.
That said, if we look at the block module, the BlockContent entity has a property named "info" which is used for a similar purpose, i.e. to add administrative description. If we want to continue using that pattern, we could add a property named "info. IMHO, the name "info" seems very generic so I'd suggest using something like "admin_description" or even "context" (as we have in string translations).
Answers/opinions/suggestions are welcome (=