Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I'm getting this error:
Parse error: syntax error, unexpected '0' (T_LNUMBER), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in MY-FEATURE.features.inc on line 12
I want to override a rule. I have PHP 5.4 installed. I'm getting this error with the latest beta- and dev-version.
Comments
Comment #0.0
Peter MajmeskuTypo
Comment #1
Miff CreditAttribution: Miff commentedHave experienced same behavior.
Comment #1.0
Miff CreditAttribution: Miff commentedTypo
Comment #2
rob_johnston CreditAttribution: rob_johnston commentedI also occasionally get parse errors. In my case, the line number of the error points directly to the problem. I have visibility rules on a panel that are set with a wildcard such as a URL of '*/rcc/*. A change to the feature will generate a comment like:
*/rcc/*'; /* WAS: '*/rcc-ccr/*
The problem is that the comment is not escaped. This can easily be corrected by replacing all occurrences of '*/' with '*\/'.
Comment #3
milesw CreditAttribution: milesw commentedSame problem when trying to export Elysia Cron rules which contain a number of asterisks and slashes.
Example that causes a parse error:
Comment #4
rootworkI'm seeing this too. It's particularly troublesome because it short-circuits both the site and Drush, so there's not even a way to clear the site's cache if you fix it by escaping the comments. You have to edit the site database to disable the feature, then remove the code entirely, then clear caches, then move the feature back (with escaped comments) and then re-enable it.
It would be really nice to see this bug get fixed.
Comment #5
jlea9378 CreditAttribution: jlea9378 commentedThe issue described in comments #2, 3 and 4 seem to be different from the issue described in the original post and comment #1.
Personally, I'm experiencing the issue described in the OP and comment #1. Has anyone come up with a solution yet?
Comment #6
jlea9378 CreditAttribution: jlea9378 commentedIn my override module that I created, I had this code and was getting the parse error described above:
Replacing the above code with the following code resolved the parse error for me:
Comment #8
mpotter CreditAttribution: mpotter commentedConverting the numeric keys to {0} is fixed in 4cc008a and 87f3943.
Can't reproduce the issue with array() being exported as Array. Features override specifically looks for arrays and outputs empty arrays as array().