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.

Comments

agentrickard’s picture

Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new10.3 KB

Here's the patch, which should remove all explicit calls to Domain Source from the main module.

nonsie’s picture

I like where this is going....

agentrickard’s picture

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).

bartezz’s picture

subscribing

Will create a copy of my setup on a local machine and test the patch or are you still working on it....

agentrickard’s picture

StatusFileSize
new10.83 KB

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.

agentrickard’s picture

StatusFileSize
new10.89 KB

API cleanup documentation cleanup.

bartezz’s picture

Will test tomorrow!
Cheers

agentrickard’s picture

StatusFileSize
new13.47 KB

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)
agentrickard’s picture

StatusFileSize
new13.44 KB

Minor API docs fix.

agentrickard’s picture

Status: Needs review » Patch (to be ported)
StatusFileSize
new13.54 KB

Even better API docs. Committed to HEAD.

agentrickard’s picture

Status: Patch (to be ported) » Closed (fixed)

Will not backport to D5.