Automated Drupal 10 compatibility fixes

Created on 18 July 2022, almost 2 years ago
Updated 27 June 2024, 1 day 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 work

Version

1.0

Component

Code

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • πŸ‡ΊπŸ‡ΈUnited States nessthehero

    Is this task under consideration by the maintainers? This module shows up on Upgrade Status under "Collaborate with maintainers" as a module that needs support.

    I don't see any other ticket tracking active progress towards Drupal 10 support. Is it planned? Is this module still actively maintained?

  • First commit to issue fork.
  • Merge request !4Draft: Drupal 10 compatibility β†’ (Open) created by Brian-C
  • πŸ‡ΊπŸ‡ΈUnited States nessthehero

    LGTM! Module works on Drupal 10.1.2 via DrupalPod, and changes in the MR seem simple enough to me.

    Also tested in 9.5.9 with Upgrade Status, and it shows up green!

    I'm still a bit new to contributing on d.o so I don't know if I need to mark this as RTBC or someone else can do that? Either way, I think this is great!

  • Status changed to RTBC 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States Albert Volkman

    Setting status per @nessthehero's review.

  • πŸ‡ΊπŸ‡ΈUnited States nomisgnos

    What is the status of this release?

  • Status changed to Needs work 12 days ago
  • πŸ‡ΈπŸ‡°Slovakia kaszarobert

    With the MR changes, although Upgrade Status says it is compatible, there's some major problem that needs to be dealt with under Drupal 10 during module install:

    Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "cache.backend.database", path: "http_kernel -> http_middleware.ajax_page_state -> http_middleware.negotiation -> http_middleware.reverse_proxy -> http_middleware.page_cache -> cache.page -> cache.backend.database -> Drupal\Component\Datetime\TimeInterface -> state -> cache.bootstrap". in Drupal\Component\DependencyInjection\Container->get() (line 149 of core/lib/Drupal/Component/DependencyInjection/Container.php).
    Drupal\Component\DependencyInjection\Container->get('cache.backend.database') (Line: 98)
    Drupal\Core\Cache\ChainedFastBackendFactory->get('bootstrap') (Line: 110)
    Drupal\Core\Cache\CacheFactory->get('bootstrap')
    call_user_func_array(Array, Array) (Line: 257)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'cache.bootstrap') (Line: 179)
    Drupal\Component\DependencyInjection\Container->get('cache.bootstrap', 1) (Line: 438)
    Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 239)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'state') (Line: 179)
    Drupal\Component\DependencyInjection\Container->get('state', 1) (Line: 438)
    Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 239)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'Drupal\Component\Datetime\TimeInterface') (Line: 179)
    Drupal\Component\DependencyInjection\Container->get('Drupal\Component\Datetime\TimeInterface', 1) (Line: 438)
    Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 239)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'cache.backend.database') (Line: 179)
    Drupal\Component\DependencyInjection\Container->get('cache.backend.database') (Line: 110)
    Drupal\Core\Cache\CacheFactory->get('page')
    call_user_func_array(Array, Array) (Line: 257)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'cache.page') (Line: 179)
    Drupal\Component\DependencyInjection\Container->get('cache.page', 1) (Line: 438)
    Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 239)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'http_middleware.page_cache') (Line: 179)
    Drupal\Component\DependencyInjection\Container->get('http_middleware.page_cache', 1) (Line: 438)
    Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 239)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'http_middleware.reverse_proxy') (Line: 179)
    Drupal\Component\DependencyInjection\Container->get('http_middleware.reverse_proxy', 1) (Line: 438)
    Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 239)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'http_middleware.negotiation') (Line: 179)
    Drupal\Component\DependencyInjection\Container->get('http_middleware.negotiation', 1) (Line: 438)
    Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 239)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'http_middleware.ajax_page_state') (Line: 179)
    Drupal\Component\DependencyInjection\Container->get('http_middleware.ajax_page_state', 1) (Line: 438)
    Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 239)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'http_kernel') (Line: 179)
    Drupal\Component\DependencyInjection\Container->get('http_kernel') (Line: 1513)
    Drupal\Core\DrupalKernel->getHttpKernel() (Line: 741)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
    

    After this error the module is enabled but the scheduled transition state and date tables are not created resulting to a broken site. Since the tables were not created, you cannot even uninstall this module because of this error:

    pc@ASUS-PC:~/lando-projects/drupal10.localhost/web/modules/custom/lightning_scheduler$ lando drush pmu lightning_scheduler
    
    In ExceptionHandler.php line 56:
    
      SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal10.block_content_r__48d0019ac1' doesn't exist: SELECT 1 AS "expression"
      FROM
      "block_content_r__48d0019ac1" "t"
      WHERE "scheduled_transition_date_value" IS NOT NULL
      LIMIT 1 OFFSET 0; Array
      (
      )
    
    
    In StatementWrapperIterator.php line 113:
    
      SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal10.block_content_r__48d0019ac1' doesn't exist
    
    

    This problem does not appear on Drupal 9 clean install. It needs to be fixed here.

  • πŸ‡¨πŸ‡¦Canada deviantintegral

    FYI there's a new error introduced in 10.3.0:

    In Container.php line 149:
    
      Circular reference detected for service "cache.bootstrap", path: "module_handler -> cache.bootstrap -> cache.backend.apcu -> Drupal\Component\Datetime\TimeInterface -> state".
    

    This is because lightning_scheduler.datetime.time decoartes datetime.time and modifies the constructor arguments, which are not part of compatibility promises by core. It may be more reliable to instead inject that via setter injection.

  • πŸ‡¨πŸ‡¦Canada slussier

    +1

  • πŸ‡ΊπŸ‡ΈUnited States fsabbagh

    +1

  • Assigned to kaszarobert
  • πŸ‡ΈπŸ‡°Slovakia kaszarobert

    I'll refactor a little bit those parts.

Production build 0.69.0 2024