Deprecate HandlerBase defineExtraOptions

Created on 1 November 2024, 6 months ago

Problem/Motivation

Discovered in ๐Ÿ“Œ Add MissingParamType for views Active that core/modules/views/src/Plugin/views/HandlerBase.php defineExtraOptions isn't used. Searching contrib space https://git.drupalcode.org/search?group_id=2&page=2&scope=blobs&search=d... I don't think anyone is using it. Probably safe to deprecate

Steps to reproduce

N/A

Proposed resolution

Deprecate the function

Remaining tasks

Deprecate
Deprecation test coverage
Change record

User interface changes

N/A

Introduced terminology

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

๐Ÿ“Œ Task
Status

Active

Version

11.0 ๐Ÿ”ฅ

Component

views.module

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

Live updates comments and jobs are added and updated live.
  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @smustgrave
  • First commit to issue fork.
  • Pipeline finished with Failed
    6 months ago
    Total: 105s
    #329760
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chandansha

    I try to resolve issue please review.
    Thanks!!

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ankitv18

    CR and Deprecation test coverage is missing, also I don't think the changes done in the MR is valid.

    cc: @smustgrave

  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands Lendude Amsterdam

    Per #5, this is indeed not the change we are looking for, we need to properly deprecate this in the base handler, we can't just remove it

  • First commit to issue fork.
  • Pipeline finished with Failed
    6 months ago
    Total: 167s
    #335350
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vinmayiswamy

    Hi, as per the feedback in #5 and #6, I have:

    1. Deprecated the defineExtraOptions() method in the HandlerBase class.
    2. Added test to ensure proper deprecation handling.
    3. Created a change record โ†’ for the deprecation.

    Kindly review the changes and please let me know if any further modifications are required.
    Thanks!

  • Pipeline finished with Success
    6 months ago
    Total: 1784s
    #335361
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    LGTM

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    The deprecated version needs to updated to 11.2.0 instead of 11.0.0.

  • Pipeline finished with Failed
    5 months ago
    Total: 826s
    #366564
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chhavi.sharma

    Updated the depricated version.
    I tried to solve the failing phpunit test but couldn't resolve it. Can anyone suggest something to pass that test?

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shalini_jha

    @chhavi.sharma I have reviewed the pipeline failure : https://git.drupalcode.org/issue/drupal-3485084/-/jobs/3674676
    and it seems like a random failure not relevant with the changes in MR, try to re-run it will fix. hope that help.

  • Pipeline finished with Failed
    5 months ago
    Total: 686s
    #369806
  • Status changed to Needs work 4 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Comment on MR.

    Maybe we can skip deprecation test since defineOptions isn't used anywhere. But the current test I don't believe is actually testing anything, just throwing a deprecation but no assertion.

  • Pipeline finished with Success
    3 months ago
    Total: 786s
    #408047
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shalini_jha

    Address the feedback on MR also rebase and fixed the conflicts, Moving this NR.Please review.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Change appears fine to me.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    Added in deprecation notice that the method has no replacement. I assume it does not. But if it does have a replacement we need to state what it is.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    Pipeline is green.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shalini_jha

    @smustgrave Can you please review the last commits? It seems these changes might not be necessary. I noticed that @oily has made similar changes in another ticket, which also seem unnecessary.

    @oily, if you believe this change is required, please add a comment. Iโ€™m already working on this ticket, I will address.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    @shalini_jha RE #22

    I noticed that @oily has made similar changes in another ticket, which also seem unnecessary.

    We are dealing with this issue unless that one is related? What I do in other tickets is immaterial. I work extremely hard on behalf of drupal.org on a great many different tickets. You fail to mention that at #19 I have updated the IS.

    Search existing deprecation notices in the core codebase and you'll find it very normal to state the method being replaced or that none is being replaced.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    @shahini_jha Perhaps you should look at what others are saying about me:

    I also did some minor edits (mostly just formatting) on the CR, and agree that looks really good.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shalini_jha

    @oily I was referring to this ticket: # 3497796 ๐Ÿ“Œ Add return type to hook_file_download implementations Active . The comment update happened after the issue reached RTBC, and that is not the scope of the ticket and unnecessary.

    I just meant that since the issue is already in RTBC status, if any changes are needed, please feel free to add a comment. I also want to ensure the issue is completed properly, I am trying to complete the issue what i have started. Thatโ€™s why I am making this request.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    RE: #25

    @oily I was referring to this ticket: #3497796.

    As I stated in #23 issue 3497796.is not related to this issue as a parent, child or in any way at all.

    If you want to start a fight about 'you did this on issue arandomticket, and you did that on issue anotherrandomissue I am not interested!

    But since you seem to want to knock this back to Needs to Review or is is Needs Work go ahead!

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shalini_jha

    @oily I was just seeking confirmation and discussing it with you. No worries at allโ€”letโ€™s see what others think about this. Iโ€™m okay with their perspective, and perhaps I was mistaken. No problem, we can focus on another ticket instead of continuing the discussion here.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    RE: #22

    @smustgrave Can you please review the last commits? It seems these changes might not be necessary, as this method is not used anywhere.

    In that case, I suggest that this notice I have just found in the core codebase contains the message that we need in your MR. (I grepped and found 2x notices stating 'Not needed anymore..')

    * @deprecated in drupal:11.1.0 and is removed from drupal:12.0.0. Not
    * needed any more.

    I suggest that you update the MR and replace my additional text with 'Not needed any more.'

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    The fact is that someone is going to need to find out why this method is being deprecated. And decide whether it is because it is 'Not needed anymore.' or 'the method has no replacement' because every single deprecation notice in the core codebase of this kind contains such a comment. Or else, they need to state why all the other deprecation notices are including unnecessary detail.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    RE: #27

    @oily I was just seeking confirmation and discussing it with you. No worries at allโ€”

    Oh, good. So if i write a comment directed as @smustgrave stating that your MR should be removed and a new one created and you keep creating MR's that need to be replace, you would be cool with that?

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    Added comments to the MR.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    I have conducted a detailed analysis of existing deprecation notices of methods in the codebase.

    There is a pattern evident in the content of every existing notice. They contain two separate types of information.

    1. A statement that the method is removed.
    2. Further information

    The further information states one and one only of the following::

    • There is no replacement
    • The method or technique or enum that should now be used instead

    The MR I encountered contained 'a statement that the method is removed.' It did not contain 'further information'. So I added the 'further information'. This 'further information' I have drawn attention to in my new comments. I am not sure it is correct.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    The body of the function should also trigger a deprecation I think. Unlikely that anything is calling this, but if it was, it would tell them.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    How to deprecate โ†’ explains the steps needed to deprecate something as well as the format of the message. It is in the Core change policies โ†’ guide where other useful things about core development can be found. I didn't realize when I last commented here that this is a novice issue, and in that case, this information should have been in the issue summary. At least, in my opinion.

    I edited the change record so that it contains only the necessary data. Anyone wanting to know more can follow the link to this issue. While it was well written we also want to be concise, simply stating what changed and any action needed to be taken. In this case there is no action, so it can be short.

    This still needs code in the function to trigger a deprecation message. I have updated the issue summary.

  • First commit to issue fork.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Sivaji_Ganesh_Jojodae Chennai

    Updated the MR to reflect comment #34 and earlier.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave
    • catch โ†’ committed f4c891ce on 11.x
      Issue #3485084 by oily, vinmayiswamy, shalini_jha, chhavi.sharma,...
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    Committed/pushed to 11.x, thanks!

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

Production build 0.71.5 2024