Hey guys,

I just setup Bakery on a number of subdomains and now that I have gotten it running it works great! One major issue that I had noticed is that user registration and settings weren't being transferred to slave sites.

I was receiving the following errors:

Problems
# Error 0 php_network_getaddresses: getaddrinfo failed: Name or service not known for site at http://atrium.ole.org
# Error 0 php_network_getaddresses: getaddrinfo failed: Name or service not known for site at http://guide.ole.org
# Error 0 php_network_getaddresses: getaddrinfo failed: Name or service not known for site at http://network.ole.org
# Error 0 php_network_getaddresses: getaddrinfo failed: Name or service not known for site at http://library.ole.org
# Error 0 php_network_getaddresses: getaddrinfo failed: Name or service not known for site at http://qa.library.ole.org

Getaddrinfo was failing because it required that all the slave sites contain a trailing slash. This was something that I didn't include.

I was wondering if we could just add a quick check in the code to indicate a warning or error with websites that don't include a trailing slash?

Cheers

Shane

Comments

juliangb’s picture

Status: Active » Needs review
StatusFileSize
new808 bytes

This patch adds the slash for you if it isn't there already.

juliangb’s picture

Title: Slave sites trailing slash check » Trailing slash check
StatusFileSize
new1.13 KB

It is also necessary to have a trailing slash on the end of the url of the master site field on each slave. Otherwise, any update of user info won't find the account because it doesn't form the 'init' field correctly to check against.

Updated patch.

juliangb’s picture

StatusFileSize
new1.13 KB

Minor change to the patch - removes trailing whitespace from the empty lines.

juliangb’s picture

Category: bug » task

It would be good to have an opinion of a maintainer for this.

The current situation is that if the trailing slash is left off either the master or slave entries in the settings, parts of functionality do not work. This hinders an already sensitive installation.

I would like to see a point where a site administrator has one less hurdle to think about, hence lowering the barriers to using the module.

This patch automatically adds the trailing slash as part of the submit handler for the admin settings form. An alternative would be to check for the trailing slash each time the url is used. I think this method is better as it means the check is only done once, rather than each time the values are used.

The current patch is for the D6 version (I'm guessing it won't apply to the D7 version as the line numbers won't correspond). I can redo it for the D7 version if needed. The actual code added should be the same.

greggles’s picture

This looks good to me. It would be nice to change the documentation to be a bit nicer and also yes, re-roll for Drupal 7.

juliangb’s picture

StatusFileSize
new1.45 KB
new1.51 KB

Attached are updated patches for both D6 and D7.

For D7, there is an existing bug that prevents this from being tested properly - see #751090-17: Bakery for Drupal 7: testing and synch-repair system. However, none of the code added depends on version, so hopefully this can be committed and we can handle that bug as part of #751090: Bakery for Drupal 7: testing and synch-repair system.

coltrane’s picture

Status: Needs review » Reviewed & tested by the community

Patches in #6 tested on D6 slave and D7 master and work great.

greggles’s picture

Title: Trailing slash check » Automatically remove trailing slashes for improved UX
Status: Reviewed & tested by the community » Fixed
juliangb’s picture

Title: Automatically remove trailing slashes for improved UX » Automatically add trailing slashes for improved UX

Minor correction to title so we're clear about the change that was made.

Status: Fixed » Closed (fixed)
Issue tags: -bakery trailing slash slave site master

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