I get the following error when I try to install the store module (I am installing it according to the install instructions here http://drupal.org/node/50364):
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in
[ed.]sites/default/modules/ecommerce/store/store.module on line 2166
This line refers to the following function:
function _store_array_distinct($array, $sub_key) {
$target = array();
$existing_sub_key_values = array();
foreach ($array as $key => $sub_array) {
//line 2166 below, offending line:
if (!in_array($sub_array[$sub_key], $existing_sub_key_ )) {
$ isting_sub_key_values[] = $sub_array[$sub_key];
$target[$key] = $sub_array;
}
}
return $target;
}
The line that calls the method is line 1747:
$header = _store_array_distinct($table, 'data');
So the error is occurring because of the 'data' string that is being passed in. I imagine that it's not part of the table array but I'm not sure what's going on with that.
Comments
Comment #1
Dustin Boston commentedI was able to fix the problem but I'm not sure why it worked. I just put a
die();before the offending line, stopped execution of the script and it installed properly, although I didn't test the integrity of the install. I then disabled the store module, reverted back to the original code, and re-enabled it and it installed just fine.My guess: maybe my tables were messed up and were fixed by killing the script and disabling the module. I think the first time through I just went through and started checking things.
The install text on this post (http://drupal.org/node/50364) was really what helped me to clarify. Maybe the information about installing in stages could be added to the README.txt. See attached.
Comment #2
brmassa commentedComment #3
kmarchand commentedParse error: syntax error, unexpected T_STRING in /var/www/website-name/htdocs/drupal-6.13/includes/common.inc(1655) : eval()'d code on line 13.
Need help. I am new to this and getting an error for trying to use the following for tabs.
Comment #4
kmarchand commentedFunny that it will work on other items but two that are not.