Automated Drupal 10 compatibility fixes

Created on 18 July 2022, over 2 years ago
Updated 3 May 2023, over 1 year ago

Problem/Motivation

Hello project maintainers,

This is an automated issue to help make this module compatible with Drupal 10.

To read more about this effort by the Drupal Association, please read: The project update bot is being refreshed to support Drupal 10 readiness of contributed projects

Patches will periodically be added to this issue that remove Drupal 10 deprecated API uses. To stop further patches from being posted, change the status to anything other than Active, Needs review, Needs work or Reviewed and tested by the community. Alternatively, you can remove the "ProjectUpdateBotD10" tag from the issue to stop the bot from posting updates.

The patches will be posted by the Project Update Bot official user account. This account will not receive any issue credit contributions for itself or any company.

Proposed resolution

You have a few options for how to use this issue:

  1. Accept automated patches until this issue is closed

    If this issue is left open (status of Active, Needs review, Needs work or Reviewed and tested by the community) and the "ProjectUpdateBotD10" tag is left on this issue, new patches will be posted periodically if new deprecation fixes are needed.

    As the Drupal Rector project improves and is able to fix more deprecated API uses, the patches posted here will cover more of the deprecated API uses in the module.

    Patches and/or merge requests posted by others are ignored by the bot, and general human interactions in the issue do not stop the bot from posting updates, so feel free to use this issue to refine bot patches. The bot will still post new patches then if there is a change in the new generated patch compared to the patch that the bot posted last. Those changes are then up to humans to integrate.

  2. Leave open but stop new automated patches.

    If you want to use this issue as a starting point to remove deprecated API uses but then don't want new automated patches, remove the "ProjectUpdateBotD10" tag from the issue and use it like any other issue (the status does not matter then). If you want to receive automated patches again, add back the "ProjectUpdateBotD10" tag.

  3. Close it and don't use it

    If the maintainers of this project don't find this issue useful, they can close this issue (any status besides Active, Needs review, Needs work and Reviewed and tested by the community) and no more automated patches will be posted here.

    If the issue is reopened, then new automated patches will be posted.

    If you are using another issue(s) to work on Drupal 10 compatibility it would be very useful to other contributors to add those issues as "Related issues" when closing this issue.

Remaining tasks

Using the patches

  1. Apply the latest patch in the comments by Project Update Bot or human contributors that made it better.
  2. Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.
  3. Provide feedback about how the testing went. If you can improve the patch, post an updated patch here.

Providing feedback

If there are problems with one of the patches posted by the Project Update Bot , such as it does not correctly replace a deprecation, you can file an issue in the Drupal Rector issue queue . For other issues with the bot, for instance if the issue summary created by the bot is unclear, use the Project analysis issue queue .

📌 Task
Status

Needs review

Version

2.0

Component

Code

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom juc1

    I have applied the automated patch.
    When using the Olivero theme everything seems fine.
    When using another D10 theme such as Bartik or my subtheme with Olivero as base theme the UI configurator in /admin/structure/block seems fine but the block (even block title) / pager--block.html.twig is not rendered at all ie looking at the browser inspector the corresponding html is empty.

  • 🇬🇧United Kingdom juc1

    Here is the result of https://github.com/mglaman/drupal-check

    $ /vendor/bin/drupal-check pager                                                                          r
     3/3 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
    
     ------ -------------------------------------------------------------------------------------
      Line   src/Plugin/Block/PagerBlock.php
     ------ -------------------------------------------------------------------------------------
      69     PHPDoc tag @param for parameter $container with type
             Drupal\pager\Plugin\Block\Symfony\Component\DependencyInjection\ContainerInterface
             is not subtype of native type
             Symfony\Component\DependencyInjection\ContainerInterface.
      69     Parameter $container of method
             Drupal\pager\Plugin\Block\PagerBlock::create() has invalid type
             Drupal\pager\Plugin\Block\Symfony\Component\DependencyInjection\ContainerInterface.
      210    Cannot access property $class on object|true.
      211    Cannot access property $class on object|true.
      214    Cannot access property $class on object|true.
      214    Cannot access property $class on object|true.
     ------ -------------------------------------------------------------------------------------
    
    
     [ERROR] Found 6 errors
    
    Thanks for using drupal-check!
    
  • 🇮🇳India sahil.goyal

    Addressing few issues described in #5 and few more needed changes.

  • 🇬🇧United Kingdom juc1

    @sahil thanks for your patch

    at /admin/structure/block I get php error =

    ArgumentCountError: Too few arguments to function Drupal\pager\Plugin\Block\PagerBlock::__construct(), 7 passed in /public_html/web/modules/non-comp/pager/src/Plugin/Block/PagerBlock.php on line 87 and exactly 8 expected in Drupal\pager\Plugin\Block\PagerBlock->__construct() (line 58 of /public_html/web/modules/non-comp/pager/src/Plugin/Block/PagerBlock.php).
    
  • 🇮🇳India sahil.goyal

    Hi @Juc1, I have verified again, it is not producing error for me after installation of this module, Could you please provide more info regarding thia error, so i can able to reproduce, Thanks for pointing it out..

  • 🇬🇧United Kingdom juc1

    Hi sahil I tried again with a new / clean D10.1 site and default Olivero theme - same issue.

    my patched PagerBlock.php = https://pastebin.com/ewuB4jHK

    generated a few nodes with devel
    enabled pager module
    go to /admin/structure/block

    Place Block / Pager Block

    /admin/reports/dblog/ =

    Type 	php
    Date 	Friday, May 5, 2023 - 12:34
    User 	admin
    Location 	example.com/admin/structure/block/add/pager/olivero?_wrapper_format=drupal_modal&region=content_above
    Referrer 	example.com/admin/structure/block
    Message 	ArgumentCountError: Too few arguments to function Drupal\pager\Plugin\Block\PagerBlock::__construct(), 7 passed in /home/819629.cloudwaysapps.com/vdrkgajfpf/public_html/web/modules/patched/pager/src/Plugin/Block/PagerBlock.php on line 87 and exactly 8 expected in Drupal\pager\Plugin\Block\PagerBlock->__construct() (line 58 of /home/819629.cloudwaysapps.com/vdrkgajfpf/public_html/web/modules/patched/pager/src/Plugin/Block/PagerBlock.php).
    Severity 	Error
    

    If you need more info please tell me what you need.

    Thanks...

  • 🇺🇸United States bkelly
  • 🇺🇸United States bkelly
  • Status changed to Fixed 2 months ago
  • 🇺🇸United States bkelly
Production build 0.71.5 2024