2

I have created a custom installation profile in which I enable some default features and modules. In the profile I added an extra task at the end in witch I enable a custom deployment module.

That deployment module I then use to enable all project specific stuff. I do this using update_N functions and a script that runs through all the updates on installation of the deployment module.

One of the last updates contains the activation of some features that have a view with a page in code, each with a path but no menu item. I need those menu items but I don't put them in the view to prevent that the view is marked overridden when a user decides to change the menu title of a menu item.

That's why I run another script in a following step that creates default menu items for each view using the menu_link_save function.

The problem is that I can trace the creation of a menu item during installation (I get an mlid back) but when installation is done there are no menu items for the views.

As I understood from another Drupal Question (Drupal installation profile: menu_link_save() doesn't work for "import" path) the problem is that the path's of the views are not defined yet at that moment.

Any suggestions on how to create menu items on installation within an update of that deployment module or is this never going to work?

Thanks in advance! Hatznie.

1

I've found it! Adding "'customized' => 1" to the options of each menu item did the trick.

  • Hey Hatznie, would be good you mark your answer as accepted. It's totally fine to accept your own answer. It helps others see the problem got solved sufficiently. – leymannx Dec 1 '16 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.