In a project that I'm working I'm using this module to automatically create menus for the different domains that are part of the multi-site installation. Bu there are some troubles when working with sub-domains while developing.

For example, I'm using dev.example.com and dev.otherexample.com to develop the sites that will be migrated from the originals example.com and otherexample.com.

The main problem is that this modules uses parts of the domain to create hash that identifies each menu automatically created, so, when other developer try to load my changes and uses other name for the site (like dev2.example.com) the whole thing starts to fail.

Of course, I did some research before ask get rid the md5 hash generation. And I fully understand what is the reason to create a key based on the machine name of the menu and the machine name of the domain where the menu is created.

And because the menu name generated based on the machine name and the domain machine name seems to be the more reasonably way to identify a menu. I would like at least suggest some changes that will allow developers to get more control in the way that the hash is defined.

So the following patch will at least give a change to alter the hash generation to have more control about what is being created in each environment.

Comments

dagmar’s picture

Status: Active » Needs review
StatusFileSize
new1.92 KB

Here is the initial patch.

dagmar’s picture

StatusFileSize
new2.94 KB

Sorry wrong patch.

agentrickard’s picture

That looks reasonable to me. We should really add some tests, too.

agentrickard’s picture

That looks reasonable to me. We should really add some tests, too.

bforchhammer’s picture

StatusFileSize
new3.69 KB

Looks good to me. Not sure if tests are required (small module?)

Previous patch was missing one function call in domain_menu_block.admin.inc; I also updated the function documentation for domain_menu_block_menu_name(). Unless you really want tests, I'd say this is RTBC.

bforchhammer’s picture

Title: Improve workflow when working with multiple server / multiple developers » Add hook for altering menu names
Status: Needs review » Fixed

I have commited this with a small addition to still support the old function signature (in order not to break any themes or other modules using the name function).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.