I am trying out the latest patterns.module in HEAD, since I'm writing some stuff against it and wanted to make sure the API was still clean.

Just wanted to alert to the fact that there is a call time pass by reference happening. Perhaps in your PHP instance you have that turned on, but PHP recommends turning it off as it is deprecated.

I made the change, but it seems to me that something in the logic is going to change with this, so it needs to be looked at by someone with better understanding of the context of this function.

--- orig	2010-04-30 17:02:15.000000000 -0400
+++ new	2010-04-30 17:02:14.000000000 -0400
@@ -731,7 +731,7 @@ function patterns_from_source($xml) {
  * Recurse through the values of a parsed xml file to create a
  * multi-dimensional representation of the data.
  */
-function _patterns_parse_tag($data, $index) {
+function _patterns_parse_tag($data, &$index) {
   $pattern = array();
   
   while ($current = $data[$index]) {
@@ -752,7 +752,7 @@ function _patterns_parse_tag($data, $ind
     switch($type) {
       case 'open':
         $index++;
-        $current += _patterns_parse_tag($data, &$index);
+        $current += _patterns_parse_tag($data, $index);
         $pattern[] = $current;
       break;
       case 'close':

Comments

vaish’s picture

Status: Needs review » Fixed

Ooops, current dev version of patterns is using DRUPAL-6--1 branch, not HEAD. I'm quite sure that HEAD actually contains quite outdated code because this issue has been fixed long time ago. I hope your work will not be affected too much by this.

Fyi, CVS instructions tab on module's project page can be helpful in determining which branch to checkout when you want to work with the code. Please let me know if you have any questions.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.