Hi,

My first core patch about a very minimal issue. In the theme_links function, there is an unnecessary $output variable that sets the previous $output variable with the exact same data as the previous variable in any case. Seems very unneeded in my opinion :)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dcam’s picture

Status: Patch (to be ported) » Needs review

Setting status...

Status: Needs review » Needs work

The last submitted patch, unnecessary-extra-output.patch, failed testing.

dcam’s picture

Issue summary: View changes
Issue tags: +Needs reroll, +Novice

The patch in the issue summary no longer applies.

robinvdvleuten’s picture

Yeah it's a rather old one so probably lot of things has changed ;)

amitgoyal’s picture

Status: Needs work » Needs review
FileSize
535 bytes

I believe the $output variable is now in use in theme_links() function. So the initial patch unnecessary-extra-output.patch is no longer relevant.

I am not sure if we should fix the minor indentation issue here with the attached patch.

dcam’s picture

The extra variable assignment still should be removed. It comes immediately after the first assignment, only inside an if statement. Maybe this was a loop at one time and the $output string had to be set to empty at the start of each pass.

As for the indentation issue, we generally do not do extra tasks like this that are out of scope of the issue. If we were already modifying that line then it wouldn't be a problem, but this issue has nothing to do with it. There are at least two reasons why:

  1. It makes patches harder to review. It may not be a big deal here, but in larger patches it does.
  2. The more important reason is that the more we change things, the more chance there is of a collision with another patch. When one of those patches gets committed, the other will need to be rerolled. A simple change like this could result in a patch (possibly a more important patch) getting delayed to a later release window.

The thing to do in this case is to search for any other active issues that may already be cleaning up theme.inc docblocks and add it there or post a follow-up issue to fix the indentation if there isn't one. Although I wouldn't bother for such a minor issue.

amitgoyal’s picture

FileSize
380 bytes

Sure @dcam and thanks for the detailed explanation!

Please see attached patch which will remove extra variable assignment.

dcam’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs reroll

No problem. I'm glad to help.

This is RTBC.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 7: unnecessary-extra-output-1890980-7.patch, failed testing.

Status: Needs work » Needs review
dcam’s picture

Status: Needs review » Reviewed & tested by the community

Random failure.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 7: unnecessary-extra-output-1890980-7.patch, failed testing.

Status: Needs work » Needs review
dcam’s picture

Status: Needs review » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 7: unnecessary-extra-output-1890980-7.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 7: unnecessary-extra-output-1890980-7.patch, failed testing.

David_Rothstein’s picture

Status: Needs work » Fixed

Committed to 7.x - thanks!

  • David_Rothstein committed 0867207 on 7.x
    Issue #1890980 by amitgoyal, robinvdvleuten: Fixed Unnecessary extra...

Status: Fixed » Closed (fixed)

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