Permalink
Browse files

fixed altering arguments passed to rules - all tests pass again.

  • Loading branch information...
1 parent 0e30b01 commit 1360e253789702091911c9267e45f35bbbdf63db fago committed Aug 19, 2008
Showing with 9 additions and 4 deletions.
  1. +5 −1 rules/rules.data_types.inc
  2. +1 −2 rules/rules.module
  3. +3 −1 rules/rules.variables.inc
View
6 rules/rules.data_types.inc
@@ -7,8 +7,12 @@
/**
* Gets the right data object for the given argument information
+ * @param $info
+ * Info about the data type.
+ * @param $data
+ * Optional data to set. Warning: Only use this, when loosing a reference is ok.
*/
-function rules_get_data_object($info, $data = NULL) {
+function rules_get_data_object($info, &$data = NULL) {
$class = 'rules_data_type';
if (($data_type = rules_get_data_types($info['type'])) && class_exists($data_type['class'])) {
$class = $data_type['class'];
View
3 rules/rules.module
@@ -290,7 +290,6 @@ function rules_theme() {
* Returns info about all defined actions
*/
function rules_get_actions($key = 'all') {
- //TODO: integrate d6 actions
return rules_gather_data('rules_action_info', $key);
}
@@ -485,7 +484,7 @@ function rules_clear_cache($immediate = TRUE) {
}
/**
- * Implementation of hook_flush_caches
+ * Implementation of hook_flush_caches().
*/
function rules_flush_caches() {
variable_del('rules_inactive_sets');
View
4 rules/rules.variables.inc
@@ -279,7 +279,9 @@ class rules_variable {
function _set_data(&$data) {
if (isset($data)) {
- $this->data = rules_get_data_object($this->info, $data);
+ $this->data = rules_get_data_object($this->info);
+ // Set the data in the data object and make sure to keep a reference intact
+ $this->data->init($data);
}
}

0 comments on commit 1360e25

Please sign in to comment.