From 761d7fe7155e649c945aa9fa4ac2545f15572c16 Mon Sep 17 00:00:00 2001 From: Tristan Olive Date: Wed, 10 Jun 2015 01:35:29 -0400 Subject: [PATCH] Do not add a profile to the vetting queue if only the country field has been changed (DBOINCP-102) --- .../user_profiles/user_profiles.features.inc | 238 +++++++++++++++--- 1 file changed, 199 insertions(+), 39 deletions(-) diff --git a/drupal/sites/all/features/user_profiles/user_profiles.features.inc b/drupal/sites/all/features/user_profiles/user_profiles.features.inc index d214b50b75..abbac51564 100644 --- a/drupal/sites/all/features/user_profiles/user_profiles.features.inc +++ b/drupal/sites/all/features/user_profiles/user_profiles.features.inc @@ -140,7 +140,16 @@ function user_profiles_rules_defaults() { '#status' => 'default', '#conditions' => array( '0' => array( - '#weight' => 0, + '#type' => 'condition', + '#settings' => array( + 'type' => array( + 'profile' => 'profile', + ), + '#argument map' => array( + 'node' => 'node', + ), + ), + '#name' => 'rules_condition_content_is_type', '#info' => array( 'label' => 'Created content is Profile', 'arguments' => array( @@ -151,31 +160,10 @@ function user_profiles_rules_defaults() { ), 'module' => 'Node', ), - '#name' => 'rules_condition_content_is_type', - '#settings' => array( - 'type' => array( - 'profile' => 'profile', - ), - '#argument map' => array( - 'node' => 'node', - ), - ), - '#type' => 'condition', + '#weight' => 0, ), '1' => array( - '#type' => 'condition', - '#weight' => 0, - '#settings' => array( - 'roles' => array( - '0' => 3519698132, - '1' => 1271379760, - ), - 'operation' => 'OR', - '#argument map' => array( - 'user' => 'user', - ), - ), - '#name' => 'rules_condition_user_hasrole', + '#negate' => 1, '#info' => array( 'label' => 'User has role(s)', 'arguments' => array( @@ -186,17 +174,22 @@ function user_profiles_rules_defaults() { ), 'module' => 'User', ), - '#negate' => 1, - ), - '2' => array( - '#type' => 'condition', + '#name' => 'rules_condition_user_hasrole', '#settings' => array( + 'roles' => array( + '0' => 3519698132, + '1' => 1271379760, + ), + 'operation' => 'OR', '#argument map' => array( - 'user1' => 'user', - 'user2' => 'author', + 'user' => 'user', ), ), - '#name' => 'rules_condition_user_comparison', + '#type' => 'condition', + '#weight' => 0, + ), + '2' => array( + '#weight' => 0, '#info' => array( 'label' => 'Compare two users', 'arguments' => array( @@ -211,18 +204,179 @@ function user_profiles_rules_defaults() { ), 'module' => 'User', ), + '#name' => 'rules_condition_user_comparison', + '#settings' => array( + '#argument map' => array( + 'user1' => 'user', + 'user2' => 'author', + ), + ), + '#type' => 'condition', + ), + '3' => array( + '#type' => 'OR', + '0' => array( + '#info' => array( + 'label' => 'Updated content\'s field \'field_background\' has been changed', + 'arguments' => array( + 'node' => array( + 'type' => 'node', + 'label' => 'Content containing changes', + ), + 'node_unchanged' => array( + 'type' => 'node', + 'label' => 'Content not containing changes', + ), + ), + 'module' => 'CCK', + ), + '#name' => 'content_rules_field_changed', + '#settings' => array( + 'field_name' => 'field_background', + '#argument map' => array( + 'node' => 'node', + 'node_unchanged' => 'node_unchanged', + ), + ), + '#type' => 'condition', + '#weight' => 0, + ), '#weight' => 0, + '1' => array( + '#weight' => 0, + '#info' => array( + 'label' => 'Updated content\'s field \'field_opinions\' has been changed', + 'arguments' => array( + 'node' => array( + 'type' => 'node', + 'label' => 'Content containing changes', + ), + 'node_unchanged' => array( + 'type' => 'node', + 'label' => 'Content not containing changes', + ), + ), + 'module' => 'CCK', + ), + '#name' => 'content_rules_field_changed', + '#settings' => array( + 'field_name' => 'field_opinions', + '#argument map' => array( + 'node' => 'node', + 'node_unchanged' => 'node_unchanged', + ), + ), + '#type' => 'condition', + ), + '2' => array( + '#type' => 'condition', + '#settings' => array( + 'field_name' => 'field_image', + '#argument map' => array( + 'node' => 'node', + 'node_unchanged' => 'node_unchanged', + ), + ), + '#name' => 'content_rules_field_changed', + '#info' => array( + 'label' => 'Updated content\'s field \'field_image\' has been changed', + 'arguments' => array( + 'node' => array( + 'type' => 'node', + 'label' => 'Content containing changes', + ), + 'node_unchanged' => array( + 'type' => 'node', + 'label' => 'Content not containing changes', + ), + ), + 'module' => 'CCK', + ), + '#weight' => 0, + ), + '3' => array( + '#weight' => 0, + '#info' => array( + 'label' => 'Updated content\'s field \'field_profile_image\' has been changed', + 'arguments' => array( + 'node' => array( + 'type' => 'node', + 'label' => 'Content containing changes', + ), + 'node_unchanged' => array( + 'type' => 'node', + 'label' => 'Content not containing changes', + ), + ), + 'module' => 'CCK', + ), + '#name' => 'content_rules_field_changed', + '#settings' => array( + 'field_name' => 'field_profile_image', + '#argument map' => array( + 'node' => 'node', + 'node_unchanged' => 'node_unchanged', + ), + ), + '#type' => 'condition', + ), + '4' => array( + '#type' => 'condition', + '#settings' => array( + 'field_name' => 'field_url', + '#argument map' => array( + 'node' => 'node', + 'node_unchanged' => 'node_unchanged', + ), + ), + '#name' => 'content_rules_field_changed', + '#info' => array( + 'label' => 'Updated content\'s field \'field_url\' has been changed', + 'arguments' => array( + 'node' => array( + 'type' => 'node', + 'label' => 'Content containing changes', + ), + 'node_unchanged' => array( + 'type' => 'node', + 'label' => 'Content not containing changes', + ), + ), + 'module' => 'CCK', + ), + '#weight' => 0, + ), + '5' => array( + '#weight' => 0, + '#info' => array( + 'label' => 'Updated content\'s field \'field_zip\' has been changed', + 'arguments' => array( + 'node' => array( + 'type' => 'node', + 'label' => 'Content containing changes', + ), + 'node_unchanged' => array( + 'type' => 'node', + 'label' => 'Content not containing changes', + ), + ), + 'module' => 'CCK', + ), + '#name' => 'content_rules_field_changed', + '#settings' => array( + 'field_name' => 'field_zip', + '#argument map' => array( + 'node' => 'node', + 'node_unchanged' => 'node_unchanged', + ), + ), + '#type' => 'condition', + ), ), ), '#actions' => array( '1' => array( - '#type' => 'action', - '#settings' => array( - '#argument map' => array( - 'node' => 'node', - ), - ), - '#name' => 'boinccore_rules_action_mark_content_for_moderation', + '#weight' => 0, '#info' => array( 'label' => 'Mark content for moderation', 'arguments' => array( @@ -233,7 +387,13 @@ function user_profiles_rules_defaults() { ), 'module' => 'BOINC core', ), - '#weight' => 0, + '#name' => 'boinccore_rules_action_mark_content_for_moderation', + '#settings' => array( + '#argument map' => array( + 'node' => 'node', + ), + ), + '#type' => 'action', ), ), '#version' => 6003,