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

CommentFileSizeAuthor
#3 1272768-3.patch1.84 KBjenlampton

Issue fork analytic-1272768

Command icon 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

dneedham’s picture

Title: Syntax error in comments.tpl.php when php shorthand is off » Syntax error in comment.tpl.php when php shorthand is off

Corrected filename in subject. Should be comment.tpl.php.

sjnorton’s picture

I 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!

jenlampton’s picture

Assigned: Unassigned » jenlampton
Status: Active » Needs review
StatusFileSize
new1.84 KB

Patch also includes some whitespace cleanup and indentation improvements.

avpaderno made their first commit to this issue’s fork.

bluegeek9’s picture

Status: Needs review » Closed (outdated)

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.