From 0e119378fafd255b8dadd3f005d6377618e985d1 Mon Sep 17 00:00:00 2001
From: jpayne <jpayne@696648.no-reply.drupal.org>
Date: Tue, 9 Oct 2012 13:23:01 -0400
Subject: [PATCH] Issue #1807770 by acrazyanimal: Add the unchanged relation parameter to the 'after updating a relation' rules event.

---
 relation.module    |    1 +
 relation.rules.inc |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/relation.module b/relation.module
index 8e343fd..67ac8da 100644
--- a/relation.module
+++ b/relation.module
@@ -639,6 +639,7 @@ function relation_save($relation, $account = NULL) {
   if (!$relation->is_new) {
     $keys = array('rid');
     $op = 'update';
+    $relation->original = relation_load($relation->rid, $relation->vid);
   }
   else {
     $relation->created = $relation->changed;
diff --git a/relation.rules.inc b/relation.rules.inc
index 815ecbd..42bf755 100644
--- a/relation.rules.inc
+++ b/relation.rules.inc
@@ -22,6 +22,7 @@ function relation_rules_event_info() {
       'group' => t('Relation'),
       'variables' => array(
         'relation' => array('type' => 'relation', 'label' => t('relation')),
+        'relation_unchanged' => array('type' => 'relation', 'label' => t('unchanged relation'), 'handler' => 'rules_events_entity_unchanged'),
       ),
     ),
     'relation_delete' => array(
-- 
1.7.2.3

