Clean up source domain handling
agentrickard - October 26, 2009 - 20:47
| Project: | Domain Access |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | patch (to be ported) |
Description
Attached is a patch that removes explicit calls to Domain Source (good) by introducing hook_domain_source_alter() in the main module API.
It also opens up the ability to rewrite non-node paths using your own rules!
This patch may need to be expanded a bit, but I like where it is so far.

#1
Here's the patch, which should remove all explicit calls to Domain Source from the main module.
#2
I like where this is going....
#3
We've needed this for a long time. Now you can just call
domain_get_node_match($nid)and get back the $domain that the node will link to.We may need a similar function for
domain_get_path_match($path).#4
subscribing
Will create a copy of my setup on a local machine and test the patch or are you still working on it....
#5
And here it is, with some documentation, too.
I don't think I will clean up the code in custom_settings_url.inc for now. This looks pretty good to go.
#6
API cleanup documentation cleanup.
#7
Will test tomorrow!
Cheers
#8
Much more optimized patch, which splits the api hook in two.
I wrote the changelog, but did not commit.
31-OCT-2009
-- #615258. Cleans up the API for domain source handling. Introduces the new hooks:
-- hook_domain_source_alter(&$source, $nid)
-- hook_domain_source_path_alter(&$source, $path)
And also the new lookup functions for finding the best links:
-- domain_get_node_match($nid)
-- domain_get_path_match($path)
#9
Minor API docs fix.
#10
Even better API docs. Committed to HEAD.