Rules integration

jcarnett - November 3, 2009 - 23:42
Project:Path redirect
Version:6.x-1.0-beta4
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

A project I'm working on required automatically creating redirects based on certain user actions. Path Redirect + Rules seemed like a nice fit, so I dropped some rules hooks into Path Redirect to do what I needed. The attached patch seems to work (though my testing has been minimal so far). The patch is against 6.x-1.0-beta4, but it also applies to 6.x-1.0-dev as of Oct. 30, 2009.

The patch adds the following:

  • A "Path is being redirected" event, triggered just before the redirect happens,
  • an "URL redirect exists for path" condition, and
  • a "Create or delete an URL redirect" action.

A small start, but hopefully it helps.

AttachmentSize
path_redirect.rules_.patch4.68 KB

#1

Dave Reid - November 3, 2009 - 23:59

Can this code be stuffed into a path_redirect.rules.inc file and not in the main file at all? Will adding proper hooks to the redirection help with this somehow?

 
 

Drupal is a registered trademark of Dries Buytaert.