Project:Domain Access
Version:6.x-2.x-dev
Component:Code
Category:task
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

#1

Priority:normal» critical
Status:active» needs review

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

AttachmentSize
615258-path-source.patch 10.3 KB

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

AttachmentSize
615258-path-source.patch 10.83 KB

#6

API cleanup documentation cleanup.

AttachmentSize
615258-path-source.patch 10.89 KB

#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)
AttachmentSize
615258-path-source.patch 13.47 KB

#9

Minor API docs fix.

AttachmentSize
615258-path-source.patch 13.44 KB

#10

Status:needs review» patch (to be ported)

Even better API docs. Committed to HEAD.

AttachmentSize
615258-path-source.patch 13.54 KB

#11

Status:patch (to be ported)» closed (fixed)

Will not backport to D5.

nobody click here