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,
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 :)
Comment | File | Size | Author |
---|---|---|---|
#7 | unnecessary-extra-output-1890980-7.patch | 380 bytes | amitgoyal |
Comments
Comment #1
dcam CreditAttribution: dcam commentedSetting status...
Comment #3
dcam CreditAttribution: dcam commentedThe patch in the issue summary no longer applies.
Comment #4
robinvdvleuten CreditAttribution: robinvdvleuten commentedYeah it's a rather old one so probably lot of things has changed ;)
Comment #5
amitgoyal CreditAttribution: amitgoyal commentedI 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.
Comment #6
dcam CreditAttribution: dcam commentedThe 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:
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.
Comment #7
amitgoyal CreditAttribution: amitgoyal commentedSure @dcam and thanks for the detailed explanation!
Please see attached patch which will remove extra variable assignment.
Comment #8
dcam CreditAttribution: dcam commentedNo problem. I'm glad to help.
This is RTBC.
Comment #11
dcam CreditAttribution: dcam commentedRandom failure.
Comment #14
dcam CreditAttribution: dcam commentedComment #18
David_Rothstein CreditAttribution: David_Rothstein commentedCommitted to 7.x - thanks!