Upon updating Domain Access from 7.x-3.4 to 7.x-3.6, I noticed that any nodes that are published to multiple domains and are set to "Use Active Domain" as the source domain no longer use the active domain for writing links in menus, etc. Instead, menu links to those nodes now point to the domain FROM which the node was originally saved. (So, if I have a node that is published to domains X, Y, and Z, and that node was originally published through the admin interface on domain X, any menu links to the node are directed to domain X.)
I'm not sure whether this is a bug or a glitch in my install, but rolling back to version 7.x-3.4 fixed the problem.
C.
Comments
Comment #1
agentrickardLikely a bug.
See these issues for the proper background:
Does it only happen with menu links? Or with any link to the node (e.g. from the default home page or from a View).
Comment #2
agentrickardThis is working normally for me when not using menu links. That suggests a caching issue.
Comment #3
agentrickardAdded my test node to the main menu. Working fine for me.
Is the menu item entered in the format node/NID?
Comment #4
agentrickardI take that back. It only works properly if the node is sent to all affiliates.
Comment #5
cossimo commentedFor pretty much any link, including from views and base base node paths (such as domain-x.com/node/222). Though interestingly, aliased paths will remain on the active domain (such as domain-x.com/aliased/path/to/222).
Comment #6
agentrickardAnd a patch.
Comment #7
cossimo commentedThe patch fixed the active domain problem, but created a different, sort of opposite, problem.
If you have system-generated links on Domain X to content that is not published on Domain X (that is, content that's published to a different affiliate), the links will use Domain X as the source domain.
Comment #8
cossimo commentedActually, that's not quite right... This seems only to be the case with existing content. If you add a new node, it seems to work as it's supposed to. I thought this might be a caching problem, but clearing the cache had no effect.
Comment #9
agentrickardThe proper status is "needs work", since we have an active patch.
I do not know what you mean by "system-generated links". Link rewrites only affect nodes.
Please be more clear. Actual path examples (e.g. node/3) are required.
Comment #10
cossimo commentedApologies...
Let's say that (1) I apply the above patch, (2) node 3 is published only to domain foo and was published before the patch was applied, (3) there is a link in the primary navigation menu to node 3 (in the form of node/3) and this menu and link appear on both domain foo and domain bar. (4) From domain bar, if I click the link for node 3, it should link to http://foo/node/3; however, it instead links to http://bar/node/3.
By contrast, let's say I apply the patch, and afterward, post a new node (node/4) only to domain foo, and put the link in the same menu that appears on both foo and bar. From domain bar, the new link correctly points to http://foo/node/4.
Thanks,
C.
Comment #11
agentrickardI cannot replicate that behavior with the patch applied. When the node was saved makes no difference.
What are the Domain Source settings for node/3? Are they NULL?
Comment #12
cossimo commentedThe domain source for the nodes in question is "Use Active Domain." However, it doesn't seem to matter what which domain I designate as a source for the node, the behavior is the same -- the links to the node only use the current domain.
Comment #13
agentrickardAnd I keep telling you that I cannot replicate that behavior with this patch.
What are we missing? What are you not telling me?
Comment #14
cossimo commentedLook, you told me ONCE that you can't replicate my problem and asked me what the source domain settings were for my nodes. I felt obliged to answer. When and if I figure out what might interesting or unique about my install, I will post that as well.
Comment #15
agentrickardYeah, I don't mean that you're not being helpful. I mean "what are we overlooking between your content and mine?" "Have you overlooked anything that might be useful?"
For instance, I had an issue like this go around and round and it turned out the OP was using Domain Access Advanced, which changes all sort of behaviors
What we really need are tests.
Comment #16
agentrickardI'm writing tests for this now, and I think the initial implementation goes too far in assigning source domains to content that currently has no assignment. In that case, DS should do nothing and let the default behavior win out.
I've already committed the test files to Git, so any patch will be against the dev branch.
Comment #17
agentrickardHere's the patch (against -dev), with included tests.
This patch radically simplifies the domain source lookups. It also removes the assumption that nodes which have a NULL assignment should be handled at all.
Comment #18
agentrickardAnyone?
Comment #19
agentrickardCommitted.
Comment #21
drupalok commentedI am sorry to open this issue again, but i updated drupal, domain access and even domain ctools to the latest version and still i have the problem that as soon as i activate DOMAIN SOURCE the links in a view on a secondary domain send me back to my default domain. when i turn DOMAIN SOURCE off, the links work.
the content is set to "active domain" - so it should stay there, right?
do i miss something? can you have a look at the site?
Comment #22
drupalok commentedit does work in the menu though
Comment #23
drupalok commentedno one? anyone?
please agentrickard help me! please please please with sugar on top! :)
Comment #24
agentrickardThat sounds like a Views caching issue, especially since the links work for normal menu items. Try clearing the Views cache.
But you say that it only happens after activating the module, so that's odd.
How are the links in the View being generated? It is possible that they are not being read properly.
It is also possible that you have bad data in the database (or no data) for some nodes. In that case, the module falls back to the default domain _defined for the node type_. So you have to configure the default source domain for each node type.
By default, this should be the active domain. See the content type editing screen to check.
If it is set to Use Active Domain, then it is also possible that some other module is interfering with the url rewrite process.
We have active tests for this behavior, so you might run those (using the Simpletest module) and see if they still pass.
Comment #25
drupalok commentedthanks so much agentrickard. i will do as told and post the results tommorow.
Comment #26
drupalok commentedSORRY for not having posted straight away....
i did as you said and resaved the content type with selecting all domains in the list (though "send to all domains" was ticked)
after that it worked!
thanks a lot and shame on me for not being faster though you were answering so fast!!!!!!
Comment #27
bluegeek9 commentedDrupal 7 in End of Life and no longer supported. We encourage you to upgrade to a supported version of Drupal. For more information, see https://www.drupal.org/upgrade.