Drupal 10 compatibility fixes

Created on 25 March 2023, over 1 year ago
Updated 3 May 2023, about 1 year ago

I will create a patch via Rector.

Feature request
Status

Fixed

Version

3.0

Component

Code

Created by

🇺🇦Ukraine super_romeo Kiev

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @super_romeo
  • @super_romeo opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇺🇸United States kthull Fort Wayne, Indiana

    The patch applies, but after checking again with upgrade status, I get the following warnings:

    File Name
    /extra_field_plus/modules/extra_field_plus_example/src/Plugin/ExtraField/Display/DeprecatedExampleNodeLabel.php

    Line
    31

    Error
    Call to deprecated method getSettings() of class Drupal\extra_field_plus\Plugin\ExtraFieldPlusDisplayBase. Deprecated in extra_field_plus:3.0.0 and is removed from extra_field_plus:3.0.0. Due to conceptual issues. Use getEntityExtraFieldSettings() instead.

    File Name
    /extra_field_plus/modules/extra_field_plus_example/src/Plugin/ExtraField/Display/DeprecatedExampleNodeLabelFormatted.php

    Line
    45

    Error
    Call to deprecated method getSettings() of class Drupal\extra_field_plus\Plugin\ExtraFieldPlusDisplayFormattedBase. Deprecated in extra_field_plus:3.0.0 and is removed from extra_field_plus:3.0.0. Due to conceptual issues. Use getEntityExtraFieldSettings() instead.

    File Name
    /extra_field_plus/modules/extra_field_plus_example/extra_field_plus_example.info.yml

    Line
    0

    Error
    Value of core_version_requirement: ^8.9 || ^9 is not compatible with the next major version of Drupal core. See https://drupal.org/node/3070687..

  • 🇺🇦Ukraine super_romeo Kiev

    That's why plugin named DeprecatedExampleNodeLabel.php.

  • 🇺🇦Ukraine super_romeo Kiev

    Value of core_version_requirement: ^8.9 || ^9 fixed.

  • 🇺🇸United States hockey2112

    Will the D10 version of this module be released soon?

  • Status changed to Needs work about 1 year ago
  • 🇩🇪Germany Grevil

    The most part of this patch is incorrect as the Drupal coding standards explicitly state, that:

    Data types in @return tags need to be fully namespaced

  • Assigned to shivam_tiwari
  • @shivam_tiwari opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • 🇩🇪Germany Grevil

    The problem still resides. I will take care of it.

  • Assigned to Grevil
  • Status changed to Needs work about 1 year ago
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • 🇩🇪Germany Grevil

    Ah, you pushed the changes to a different branch, I see. My apologies.

  • Assigned to Grevil
  • Status changed to Needs work about 1 year ago
  • 🇩🇪Germany Grevil

    Nope, still not it. "DeprecatedExampleNodeLabel" is called like this for a reason. No need to remove deprecated methods inside this class.

  • 🇩🇪Germany Grevil

    The last few compatibility issues, need to be solved upstream:

    FILE: web/modules/custom/extra_field_plus/extra_field_plus.module
    
    STATUS         LINE                           MESSAGE
    --------------------------------------------------------------------------------
    Check manually 50   Call to deprecated method fieldInfo() of class
                        Drupal\extra_field_plus\Plugin\ExtraFieldPlusDisplayManager.
                        Deprecated in extra_field:8.x-2.0 and is removed from
                        extra_field:3.0.0. Use
                        ExtraFieldManagerBaseInterface::fieldInfo instead.
    --------------------------------------------------------------------------------
    Check manually 239  Call to deprecated method fieldInfo() of class
                        Drupal\extra_field_plus\Plugin\ExtraFieldPlusDisplayManager.
                        Deprecated in extra_field:8.x-2.0 and is removed from
                        extra_field:3.0.0. Use
                        ExtraFieldManagerBaseInterface::fieldInfo instead.
    --------------------------------------------------------------------------------
    Check manually 315  Call to deprecated method fieldInfo() of class
                        Drupal\extra_field_plus\Plugin\ExtraFieldPlusDisplayManager.
                        Deprecated in extra_field:8.x-2.0 and is removed from
                        extra_field:3.0.0. Use
                        ExtraFieldManagerBaseInterface::fieldInfo instead.
    --------------------------------------------------------------------------------
    

    Hence, the parent class "ExtraFieldDisplayManager" is using the deprecated method itself. So until that isn't changed, we can't really do much about it.

    I removed the deprecated classes, as they are not currently used their removal shouldn't break anything. Please review!

    (Note, I reset the "3350337-drupal-10-compatibility" branch, so changes are inside there).

  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • Assigned to Grevil
  • Status changed to Needs work about 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    I removed the deprecated classes, as they are not currently used their removal shouldn't break anything. Please review!

    Is this required to be D10 compatible? Otherwise I'd see this as scope-creep and would suggest to restore them again.
    I see risk to break things and if there's no good reason, this isn't the place to do that.

    Re #16 is there an issue for that in the parent project already? If not, could you please create one or add that information there @Grevil?

  • 🇩🇪Germany Anybody Porta Westfalica

    BTW: #4 shows that these classes seem to be (auto-)called! Not having a direct call on these files doesn't have to mean they are not called.

  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Grevil

    @Anybody, concerning "#19" yes indeed, having these Classes inside the module will break the D10 compatibility as they include multiple method calls, which are removed from Drupal 10. Also, these classes reside inside the "extra_field_plus_example" module, which should NOT be used for production. Furthermore, when we implemented the newer version of these Classes, we changed their ids from "example_node_label" to "deprecated_example_node_label", so if there is a breakage it should have already happened...

    I see no reason to have these classes rotting inside the module folder.

    Also note, that "#4" only shows "upgrade-status:analyze" output. Not an actual error on the website.

  • Status changed to Needs review about 1 year ago
  • 🇩🇪Germany Grevil

    > Re #16 is there an issue for that in the parent project already? If not, could you please create one or add that information there @Grevil?

    No need for an issue, the error states, that the feature will get deprecated in "extra_field_plus:3.0.0". As there currently is no 3.x branch, there is no deprecation (yet).

  • Status changed to RTBC about 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    @Grevil: RTBC with the change at UPGRADE.md! Thanks!

  • 🇩🇪Germany Anybody Porta Westfalica
  • Issue was unassigned.
  • Status changed to Fixed about 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024