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.
Problem/Motivation
In #2909163: Fix 'Drupal.Commenting.InlineComment.WrongStyle' coding standard and related issues we noticed this:
core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php
$operator = 'IN';# " IN (" . implode(', ', array_fill(0, sizeof($this->value), '%d')) . ")";
Proposed resolution
Follow the steps in #2909362: [meta] Commented-out code in Drupal to determine why this comment is there and whether it is safe to remove it.
Remaining tasks
- Use
git log -L
. - This might even date to the contrib Views module so you can also check there.
- Check to ensure that the code with this comment has test coverage.
Comment | File | Size | Author |
---|---|---|---|
#3 | Views-before-VDC-commit-log.png | 234.28 KB | karthikkumarbodu |
#3 | views_TaxonomyIndexTidDepth_has_a_weird_commented_IN_condition-2909373-3.patch | 633 bytes | karthikkumarbodu |
Comments
Comment #2
xjmA novice could do this task. Be sure to research when the commented code was added (what issue, what comment, etc.) and explain it clearly in your issue comments.
Comment #3
karthikkumarbodu CreditAttribution: karthikkumarbodu as a volunteer and at Axelerant commented@xjm This commented out code was added before views module became part of the core.
There was no issue number or comment number found in the log message.
I feel that we can get rid of this commented code as it doesn't make any sense in the existing logic.
Attaching the patch to remove the commented code.
Comment #4
mfernea CreditAttribution: mfernea at AmeXio commentedI agree that the comment was there before Views became part of core. This is the commit for the 8.x branch: bd65ce7887.
I also think that we can safely remove this comment.
Comment #5
f4o CreditAttribution: f4o commentedI'm reviewing it now on DC Sprints
Comment #6
f4o CreditAttribution: f4o commentedChecked this function and applied patch successfully. Seams perfectly fine to me.
Comment #8
mfernea CreditAttribution: mfernea at AmeXio commentedRemoving a comment fails the tests?! :) I re-submitted the patch for testing.
Comment #9
dawehnerI assume this was purely a random failure :)
The value is stored in
$this->value
so it will be picked up later:Comment #13
mfernea CreditAttribution: mfernea at AmeXio commented