Closed (fixed)
Project:
Drupal core
Version:
9.1.x-dev
Component:
aggregator.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Jun 2020 at 06:41 UTC
Updated:
8 Jul 2020 at 21:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
shaktikKindly Review Patch
Comment #3
shaktikComment #4
shaktiksorry of first #2 patch Please check #3 patch.
Comment #5
shaktikComment #6
shaktikComment #7
Rkumar commentedInterestingly it's a legacy code :)
Comment #8
sivaji_ganesh_jojodae commentedShould not the REQUEST_TIME be replaced with the \Drupal::time()->getRequestTime()?
Comment #9
pavnish commented@DevJoJodae Hi i think this is the deprecation it would be great if we can create separate ticket for deprecation.
Comment #10
avpadernoYes, using a service instead of a constant is out of topic for this issue, which is about removing a variable that isn't used.
Comment #11
avpadernoComment #12
avpadernoYes, the
$nextvariable is initialized, but never used. This patch removes every reference to that variable from the code.Comment #13
avpadernoI also verified the code used from the
AggregatorControllerclass doesn't contain other references to that variable.Comment #17
xjmTypically, when I see unused variables, I like to know why they're there (as sometimes it can be covering up other bugs).
git log -Lfor theelseif, and it looks like the variable definition was added in #2228823: Aggregator feed overview misleading text .12b8a2f77) and verified that the variable was also unused in the original commit.$nextin the original patch, and was renamed without explanation in comment 4 of that issue (with no changes to the logic). That's when the duplication was introduced.So, it looks like this is indeed a safe cleanup.
As a cleanup of dead code for a local variable, this is eligible for backport to the production branch. So, committed to 9.1.x, and cherry-picked to 9.0.x and 8.9.x. Thanks!