- Issue created by @prudloff
Automatically closed - issue fixed for 2 weeks with no activity.
We hide the fontawesome fields on the menu link content add form for some of our users.
When they submit the form, it fails with this error:
TypeError:
array_merge(): Argument #1 must be of type array, null given
at modules/contrib/fontawesome_menu_icons/fontawesome_menu_icons.module:131
at array_merge(null, array('fa_icon' => '', 'fa_icon_prefix' => 'fa', 'fa_icon_tag' => 'i', 'fa_icon_appearance' => 'before'))
(modules/contrib/fontawesome_menu_icons/fontawesome_menu_icons.module:131)
This happens because $menu_link->link->first()->options
is NULL.
Add this kind of hook:
function foo_form_menu_link_content_form_alter(&$form) : void {
$form['fa_icon']['#access'] = FALSE;
}
Then try to create a menu link.
Check if $menu_link_options is NULL before using it.
Active
3.0
Code
Automatically closed - issue fixed for 2 weeks with no activity.