Problem/Motivation
File analytic/comment.tpl.php has a syntax error within a PHP /**/ comment block.
This causes access to nodes/comments to render improperly, with a mostly white background and no css style whatsoever. Seen with CentOS 5.6 + Drupal 7.8 + PHP 5.3.3.
Verify with:
$ cd public_html/themes/Analytic/analytic
$ php -l comment.tpl.php
PHP Parse error: syntax error, unexpected '*' in comment.tpl.php on line 13
Errors parsing comment.tpl.php
Proposed resolution
A block of 3 lines is commented out, but uses shorthand syntax <? ?>.
PHP is from stock yum install and has short_open_tag set to off.
The error is reported on line 13, but actually starts on line 11.
Original code (line 11):
<?/*php print render($title_prefix); ?>
Proposed fix (line 11):
/*print render($title_prefix);
Remaining tasks
I'm not sure why the 3 lines of code are blocked out, but using long-form syntax gets rid of the error on a php engine compiled with short_open_tag off.
Note file node.tpl.php uses a similar shorthand but does not generate a php error. I suspect the difference is it's contained within a single php statement, whereas the block in comments.tpl.php spans multiple statements. Anyway it's probably best to avoid shorthand syntax anyway.
User interface changes
None
API changes
None
Original report by [username]
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 1272768-3.patch | 1.84 KB | jenlampton |
Issue fork analytic-1272768
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
dneedham commentedCorrected filename in subject. Should be comment.tpl.php.
Comment #2
sjnorton commentedI just ran into this myself, with the version of 7.x-1.x-dev dated 30 September 2013. It's an easy fix, but gave me quite a time figuring out what the problem was. Would be great if this fix could be included soon!
Comment #3
jenlamptonPatch also includes some whitespace cleanup and indentation improvements.
Comment #6
bluegeek9 commented