Closed (fixed)
Project:
Domain
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Mar 2011 at 21:58 UTC
Updated:
6 Aug 2011 at 18:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
agentrickardThis is a domain-sensitive version of Path module, targeted at nodes. Domain Access itself doesn't handle anything but nodes ATM, so this module is targeted at the node form.
However, patches that add targeted functionality for non-node links would be great. The database structure supports it, we just need the UI piece.
See also http://drupal.org/sandbox/agentrickard/1080434.
Comment #2
geaseAre we talking about the same thing? I was talking just about nodes. What I'm asking about is:
I have 2 domains, say, domain1 and domain2. On node edit form, I can set path as usual (say, "path"), and domain-specific paths (say, "path1" and "path2"). All of the following urls work: domain1/path, domain2/path, domain1/path1, domain2/path2. But the url function will always generate domain1/path or domain2/path. Thus, if I have, say, a list of teasers with links to full nodes, links there would always be domain1/path or domain2/path, and I want them to be domain1/path1 or domain2/path2. Technically this is quite easy (I believe) using hook_url_outbound_alter.
So you haven't implemented this functionality intentionally or not - that was my question.
Comment #3
agentrickardThat should be the current behavior. domain_url_rewrite_outbound_alter() should invoke domain_path_domainpath() to rewrite the url properly.
Comment #4
agentrickardAre you working in 6 or 7? In d6 you might need the url_alter module.
Comment #5
geaseOk, there were too many words. Here's the drupal 6 version with outbound links changed.
Comment #6
geaseThis doesn't seem to be the current behaviour. There's no implementation of hook_outbound_links_alter in 7.x-1.0-beta1. I've installed domain access and domain path on 7 to check, though I'm working on 6. For 6, I've made url_alter required module. I've implemented hook_outbound_links_alter and added a couple of lines to domain_path_paths.
Comment #7
agentrickardNo. That approach is wrong. Domain Access itself handles hook_url_outbound_alter() in both D6 and D7. It then fires an internal hook to domain_path. See the domain access api and hook_domainpath().
If it's failing for you as-is in D7, something else is wrong. This is either a support issue or a bug. Not a feature request, because this is the default feature of the entire module.
If you are having d6 problems, we should address in the d6 backport issue.
Comment #8
agentrickardSee the last logic statement in domain_url_outbound_alter().
Comment #9
geaseOk, I see. The problem is that the chunk of code you refer to is wrapped into condition
if ($check_nodes || $path_alter)Neither of these is true:$check_nodes = $check || $seo || $use_source;$checkmeans that the user is able to search across all domains. I don't want it.$seomeans that if the node is published to all domains, the links will go to primary domain. I don't want it.$use_sourcemeans that some modules override domain source (?). I don't have such modules.$path_alter = (bool) count(module_implements('domain_source_path_alter'));To say the truth, I fail to understand what are hook_domain_source_path_alter and hook_domain_source_alter, but they are absent in domain_path module and it seems that I don't need them. In brief, I want different domains look like different sites to end-users and robots.So, implementation of hook_domainpath is skipped.
This is probably bug report that belongs to domain access issue queue, I won't move it myself though. And I'll be happy if you suggest a correct solution.
Comment #10
agentrickardWe need to move the final IF block out of the one it's in, then. We never noticed because the above conditions have been true on all the current sites.
Try moving this part:
To:
This would be the first time I've ever seen that hook used outside the current logic. If that works, then it's a bug in the main module.
Comment #11
agentrickardAlso affects 7.x
Comment #12
agentrickardPatch against Domain Access 6.x.2
Comment #13
agentrickardThat won't actually work, since $target_domain_id might not be set.
Comment #14
geaseWhy not to change
to
then? It works for me.
Comment #15
agentrickardYes, that would. (I came up with the same solution this morning; I just needed some time to think, since I was really busy yesterday.) It also works if we just move the $target_domain_id outside of the first IF loop.
The theory here is that we only want domain modules to implement one instance of url rewrite.
Here's a proper patch for D6.
Comment #16
alladdin commentedPatch from #15 is working.
Comment #17
agentrickardThanks! Are you using one of the modules (Domain Path or Domain URL) that need it?
Comment #18
agentrickardLooks good and clears the way for a Domain Path release on D6.
Comment #19
agentrickardTested with both Domain Path and table prefixing in D6, btw.
Comment #20
agentrickardLooks like a cross-post. This is fixed in all versions.