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

agentrickard - October 26, 2009 - 20:48
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

nonsie - October 26, 2009 - 21:51

I like where this is going....

#3

agentrickard - October 27, 2009 - 13:07

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

Bartezz - October 27, 2009 - 14:55

subscribing

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

#5

agentrickard - October 27, 2009 - 14:57

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

agentrickard - October 27, 2009 - 15:00

API cleanup documentation cleanup.

AttachmentSize
615258-path-source.patch 10.89 KB

#7

Bartezz - October 27, 2009 - 22:03

Will test tomorrow!
Cheers

#8

agentrickard - October 31, 2009 - 17:22

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

agentrickard - October 31, 2009 - 17:23

Minor API docs fix.

AttachmentSize
615258-path-source.patch 13.44 KB

#10

agentrickard - November 1, 2009 - 16:31
Status:needs review» patch (to be ported)

Even better API docs. Committed to HEAD.

AttachmentSize
615258-path-source.patch 13.54 KB
 
 

Drupal is a registered trademark of Dries Buytaert.