Removed empty PHP blocks from templates left over from git migration.

Comments

josevitalsouto’s picture

code-cleanup-php-blocks.diff queued for re-testing.

pfrenssen’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

tr’s picture

Version: 7.x-dev » 8.x-dev
Category: feature » bug
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new2.11 KB
new1.07 KB

Ported the patch to D8, since these things need to be fixed in D8 first. I also re-uploaded the patch from the original post with a name change so the D8 testbot will ignore it. D7 patch was already successfully tested by the bot and reviewed in #2.

D7 patch affected Seven and Garland. Garland is out of D8, so D8 patch only touches Seven.

In case anyone's curious, these empty PHP blocks were left over when TGGM stripped out the CVS $Id$ keywords back in February. The top of these template files used to look like:

<?php
// $Id$
?>

Which was turned into the following after the migration:

<?php
?>
pfrenssen’s picture

Status: Needs review » Reviewed & tested by the community

Looks good too.

catch’s picture

Title: Code cleanup: Removed empty PHP blocks. » Code cleanup: Removed empty PHP blocks from templates left over from git migration
Version: 8.x-dev » 7.x-dev
Issue tags: +Needs backport to D7

@TR, thanks for explaining how these got in there, glad it's not the fault of a human for a change.

Committed/pushed to 8.x, the 7.x patch looks good to me as well.

jbrown’s picture

Title: Code cleanup: Removed empty PHP blocks from templates left over from git migration » tpl.php files are missing file docblocks
Version: 7.x-dev » 8.x-dev
Component: base system » Seven theme
Status: Reviewed & tested by the community » Needs work

This is not right. Seven's tpl.php files need to have proper php docblocks at the top like every other tpl.php in core.

http://drupal.org/node/1354#files

David_Rothstein’s picture

Historically, I think core themes actually did not put docblocks in their tpl.php files (leaving that to the default tpl.php files to do, since it would mostly be duplicated documentation).

But when Bartik was added to core, it went in with the docblocks. And since then, Garland (which did not have them) has been removed. So now, it's basically Bartik vs. Seven, each of which is following different standards...

That said, maybe it's time to change the standard? There's some value in having the documentation right there in the file. Plus, because of preprocess functions and the like, the theme itself can in theory have different variables available than the default tpl.php implementation does.

tr’s picture

Title: tpl.php files are missing file docblocks » Code cleanup: Removed empty PHP blocks from templates left over from git migration
Version: 8.x-dev » 7.x-dev
Component: Seven theme » base system
Status: Needs work » Reviewed & tested by the community

Re: #6

This is not right. Seven's tpl.php files need to have proper php docblocks at the top like every other tpl.php in core.

That may be true, but docblocks have absolutely nothing to do with this issue. Please open another issue if you want to address that.

Resetting issue status/title/version/component to where it was in #5.

Right now we have a patch that's been committed to D8, and a D7 version of the patch that's been marked RBTC but not yet committed.

jbrown’s picture

Status: Reviewed & tested by the community » Needs work

Docblocks need the php delimiters, but I guess it doesn't matter if they get removed now. They can be put back when / if someone writes the docblocks.

The D7 patch needs resubmitted to trigger the test bot.

tr’s picture

Status: Needs work » Reviewed & tested by the community

The D7 patch by @vitalsouto in the original post was already successfully tested by the bot (http://qa.drupal.org/pifr/test/205043) and reviewed in #2 and #5, as well as by me in #3.

Nothing has changed since then.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

The patch looks right to me. Committed and pushed to 7.x. Thanks!

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

Anonymous’s picture

Issue summary: View changes

explanation