Skip to content
Snippets Groups Projects
Commit b784a6b6 authored by Igor Biki's avatar Igor Biki
Browse files

ISTWCMS-5009: Using new form alter hook to prevent home page as parent.

parent 70726889
No related branches found
No related tags found
1 merge request!148ISTWCMS-5009: Using new form alter hook to prevent home page as parent
......@@ -497,11 +497,11 @@ function uw_cfg_common_form_menu_edit_form_alter(array &$form, FormStateInterfac
/**
* Implements hook_form_FORM_ID_alter().
*
* Menu link edit form: admin/structure/menu/link/LINK/edit.
* Menu link edit form: admin/structure/menu/item/ID/edit.
*
* Do not allow the home page to be parent of any item.
*/
function uw_cfg_common_form_menu_link_edit_alter(array &$form, FormStateInterface $form_state, string $form_id): void {
function uw_cfg_common_form_menu_link_content_menu_link_content_form_alter(array &$form, FormStateInterface $form_state, string $form_id): void {
// No changes for those with access.
if (\Drupal::currentUser()->hasPermission('bypass home page protection')) {
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment