Skip to content
Snippets Groups Projects
Commit b112e621 authored by Bram Driesen's avatar Bram Driesen Committed by Matthieu Scarset
Browse files

Issue #3427263: Attempt to assign property "options" on null

parent 98ff99f8
No related branches found
No related tags found
1 merge request!13Issue #3427263: Attempt to assign property "options" on null
......@@ -191,6 +191,11 @@ function menu_manipulator_form_menu_link_content_form_alter(array &$form, FormSt
* Entity builder for menu item entity form.
*/
function menu_manipulator_menu_link_content_form_entity_builder($entity_type, EntityInterface $menu_link, &$form, FormStateInterface $form_state) {
// Don't do anything when we have no link.
if (!$menu_link->link || $menu_link->link->isEmpty()) {
return;
}
// Attach extra options to Menu Link Content entity.
$menu_link_options = $menu_link->link->first()->options ?: [];
$menu_link_options['icon'] = $form_state->getValue('menu_link_icon');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment