Needs review
Project:
Menu Markup
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Apr 2018 at 21:50 UTC
Updated:
9 Jun 2022 at 19:48 UTC
Jump to comment: Most recent
External or all non internal links are not processed by this module. The rediscover flag must be set so they are process and decorated.
This code added. See github.
/**
* When saving entity override the default logic in \Drupal\menu_link_content\Entity\MenuLinkContent::preSave
* and set rediscover for any link that has a link_markup.
* This is needed as only internal:// links are discovered and thus decorated.
*/
function menu_markup_menu_link_content_presave($menu_link) {
$menu_link_options = $menu_link->link->first()->options;
if (isset($menu_link_options['menu_markup']) && strlen($menu_link_options['menu_markup']['link_markup']) > 0) {
$menu_link->setRequiresRediscovery(TRUE);
}
}
Comments
Comment #2
geoanders commented