From looking at the code it looks like this module is using numeric domain ids, which makes it difficult to export and maintain context settings across different environments. Would it be possible to switch over to domain machine names introduced in the domain 3.x?

Comments

bforchhammer’s picture

StatusFileSize
new2.55 KB

Here's a patch which replaces numeric domain ids with machine names. Patch requires the 3.x of the domain module, and it includes an update function which updates all existing contexts...

bforchhammer’s picture

Status: Active » Needs review
bforchhammer’s picture

StatusFileSize
new2.55 KB

Fixed a misspelled variable name. Tested and this one works ;-)

xjm’s picture

This sounds like a good feature. I'd like to see some other folks' results of testing it on actual sites with content, since I don't use this module in D7 and it doesn't have a test suite. Thanks!

Also, minor issue; the patch is missing a newline at the end of the .install file.

bforchhammer’s picture

StatusFileSize
new2.53 KB

Thanks for your comment! I have fixed the newline...

chromix’s picture

Just wanted to confirm that patch #5 worked beautifully. Thanks!

bforchhammer’s picture

@chromix: Did you test the update function on a site with existing contexts? If yes, you can probably set the status to RTBC :) thanks!

mstef’s picture

Looks good to me

jsacksick’s picture

I just tested the patch #5 and the update didn't work for me (for some reasons, I had a values array containing FALSE)
I slightly modified the update hook to make it work and now only the modified contexts are saved.

thebravecowboy’s picture

Patch #5 works cleanly for me. I used the update hook on a site with multiple domain contexts built out. It replaced the ids cleanly and exported cleanly in my features.

Can we get this merged into the main module code? Using db ids totally subverts any real devops/development workflows.