I think this is just to do with Domain Content rather than any other changes I've made (i18n etc) so apologies in advance if it's not:
Two domains, foo.com and bar.com
- On foo.com go to admin/domain/content
- Click on Bar content
- This lists content such as page1 and page2 which are published only on bar.com
- Click on the title of the page to view it
- Get 404ed as you are taken to foo.com/page1 where the pages aren't published
When you're viewing the available content for bar.com, it seems to me you should be taken to bar.com when clicking on the title. Does that seem OK?
I've patched this on my local installation, although I've also made the edit and delete operations take you to the right domain as well as I've a slightly complicated i18n use case as I want people to edit them on a domain which the correct language settings.
(I also added in something to my custom modules hook_node_access so that if people go to bar.com/node/1/edit from admin/domain/content and they're not logged in, they get taken to the login screen and then returned to node/1/edit after a login.)
Maybe for the majority of cases edit/delete should be done from the current domain to avoid that, so if you want me to create teh simpler patch, I can do that (assuming that even this use case is warranted)
Comments
Comment #1
agentrickardThis sounds like an i18n collision, as this behavior is not replicable.
The links all point to the proper canonical domain that is set for the node. Check the settings that control linking behavior, particularly Search Engine Optimization and Default Source Domain as described on https://drupal.org/node/1121614.
You can also use the Domain Source module to set the canonical domain. Without Domain Source, the canonical domain is derived for you. Note that any node set to "all affiliates" in this model will link to the current domain, which sounds like what you are experiencing.
Check also to see if another module implements hook_url_outbound_alter(), as that might be interfering.
Comment #2
apemantus commentedAh OK; I have got a fairly complex i18n set up so I guess something could be interfering down the line, although I've checked and it doesn't appear to be locale_url_outbound_alter.
I've not been using canonical domains (as conceptually we don't have such a thing I guess) and am not using Domain Source.
If I turn on "Rewrite all URLs to point to a single source" then the links do work and go to a valid domain/page.
Unless something else is interfering behind the scenes, this still doesn't work quite as I'd want it to work. So for example; if there's a page published in English (on US site) and a page published in Spanish (on Spain site) then if those two pages are published on the Mexican site, viewing the content for Mexico (even on the Mexican site) means that the pages (and edit links) go to the US and Spanish sites.
If this is the intended behaviour, then cool, and I'll either maintain my patch or (more cleanly) try and use hook_form_alter. If something's still messing up, I'll dig deeper into what could be causing the collision.
(I guess my other option is to leave off single source url rewriting but make it so that the relevant admin/domain/content page for each domain can only be viewed on that domain)
Comment #3
agentrickardThis works as designed.
Comment #4
apemantus commentedFor anybody else in the future who also has non-standard needs, it was easy enough to use hook_domain_path to rewrite urls on admin/domain/content/[0-9] that were in the form of node/[0-9].
Comment #5
shaneonabike commentedJust to add that after enabling Domain Source this worked a trick because you can have it force the use of the domain url to the active domain! Super handy and resolved sooo many issues