Problem/Motivation

Hello project maintainers,

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

Changes will periodically be added to this issue that remove deprecated API uses. To stop further changes 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 "ProjectUpdateBotD12" tag from the issue to stop the bot from posting updates.

The changes 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 changes 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 "ProjectUpdateBotD12" tag is left on this issue, new changes 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 changes 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 changes. The bot will still post new changes then if there is a change in the new generated patch compared to the changes that the bot posted last. Those changes are then up to humans to integrate.

  2. Leave open but stop new automated changes.

    If you want to use this issue as a starting point to remove deprecated API uses but then don't want new automated changes, remove the "ProjectUpdateBotD12" tag from the issue and use it like any other issue (the status does not matter then). If you want to receive automated changes again, add back the "ProjectUpdateBotD12" 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 changes will be posted here.

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

    If you are using another issue(s) to work on Drupal 12 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.

Using the merge request

  1. Review the merge request and test it.
  2. Thoroughly test the changes. These changes 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 merge request, create a new branch and merge request and work from there.

Warning: The 'project-update-bot-only' branch will always be overwritten. Do not work in that branch!

Providing feedback

If there are problems with one of the changes 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.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

project update bot created an issue. See original summary.

project update bot’s picture

Status: Active » Needs review
StatusFileSize
new3.08 KB
new1.35 KB

This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.

It is important that any automated tests available are run and that you manually test the changes.

Drupal 12 Compatibility

According to the Upgrade Status module, even with these changes, this module is not yet compatible with Drupal 12.

Currently Drupal Rector, version dev-main, cannot fix all Drupal 12 compatibility problems.

Therefore, these changes did not update the info.yml file for Drupal 12 compatibility.

The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.

Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot to post additional Drupal 12 compatibility fixes as they become available in Drupal Rector.

Debug information

Bot run #12-839256

These packages were used to generate the fixes:

  1. drupal/upgrade_status: 5.0.0-alpha2
  2. mglaman/phpstan-drupal: 2.0.15
  3. palantirnet/drupal-rector: dev-main

project update bot’s picture

This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.

It is important that any automated tests available are run and that you manually test the changes.

Drupal 12 Compatibility

According to the Upgrade Status module, even with these changes, this module is not yet compatible with Drupal 12.

Currently Drupal Rector, version 1.0.0-beta7, cannot fix all Drupal 12 compatibility problems.

Therefore, these changes did not update the info.yml file for Drupal 12 compatibility.

The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.

Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot to post additional Drupal 12 compatibility fixes as they become available in Drupal Rector.

Debug information

Bot run #12-864040

These packages were used to generate the fixes:

  1. drupal/upgrade_status: 5.0.0-alpha2
  2. mglaman/phpstan-drupal: 2.0.15
  3. palantirnet/drupal-rector: 1.0.0-beta7
relative23’s picture

Issue summary: View changes

I maintain ffmpeg_media, which depends on advancedqueue and aims to be Drupal 12 ready ahead of the release. Since drupal/core 12.x-dev became installable, our CI runs the module's full suite (3,918 tests) against core 12.x-dev on every push, with advancedqueue installed through composer-drupal-lenient. Sharing our results, because they both confirm this MR and show what else is needed for a working release.

MR !42 review (tested against core 11.x mainline, where every removed-in-D12 API already raises "removed from drupal:12.0.0" deprecations; PHP 8.5.2, SQLite, module at 8.x-1.x HEAD d2a7a23 vs. MR head 74a0d12):

  • Without the MR: "Passing the $fetch argument as an integer to fetchAllAssoc() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0" fires from runtime code (the Database backend's duplicate detection) — a hard break on Drupal 12, not just noise. And all 12 kernel tests trip "Kernel test classes must specify the #[RunTestsInSeparateProcesses] attribute … will throw an exception in drupal:12.0.0".
  • With the MR: both gone, zero module-attributable removed-in-12 deprecations left in unit/kernel; the DeprecationHelper pivot keeps the fix BC down to the module's 10.2 floor. Unit + kernel (20 tests / 120 assertions) and the functional QueueTest (5 / 98) were green in all four runs.

Runtime testing against actual core 12.x-dev — the 8.x-1.6 release (what composer resolves) fatals twice:

  1. Declaration of Drupal\advancedqueue\QueueListBuilder::getDefaultOperations(EntityInterface $entity) must be compatible with …ConfigEntityListBuilder::getDefaultOperations(EntityInterface $entity, CacheableMetadata $cacheability) — any route rebuild dies. This is already fixed on 1.x-dev in #3588704, but it is not in any tagged release.
  2. InvalidArgumentException: Class "advancedqueue_views_data" does not exist on every views-data rebuild — Drupal 12 no longer autoloads .views.inc, and in 1.6 the hook only lives there. 1.x-dev already has the OOP #[Hook('views_data')] class, so the dev branch looks fine here too.

The small backport patch we apply to 8.x-1.6 in our own CI (via composer-patches) lives tag-pinned in our repository, so dependent modules can test on core 12.x-dev today: advancedqueue-d12-compatibility.patch. It mirrors the dev-branch behaviour for both points and is BC to ^10.2.

Suggested path: merge !42, bump core_version_requirement to ^10.2 || ^11 || ^12, and — importantly — tag a release: 1.6 is what composer installs, and on Drupal 12 it cannot survive a route or views rebuild. Happy to re-test 1.x-dev + !42 directly against core 12.x-dev if that helps move this along.

relative23’s picture

Obsolete, please ignore this comment. Two claims in it were wrong: FetchAs does not exist before Drupal 11.2, so swapping the constant is not backward compatible with ^10.2, and 1.x-dev does not cover that point either. Retested in #7.

relative23’s picture

I retested this on Drupal 12.0.0-alpha1 using stock 8.x-1.7 and the current 8.x-1.x-dev snapshot.

Two of the three issues from #6 are fixed in 1.7. I confirmed this file by file. QueueListBuilder works without changes because core's getOperations() replaces the null value before calling getDefaultOperations(). The views data comes from src/Hook/AdvancedqueueViewsHooks.php, so dropping .views.inc autoloading no longer matters.

One issue remains in both 1.7 and 1.x-dev. It is in Database.php:252 inside getDuplicateJobs():

$result->fetchAllAssoc('job_id', \PDO::FETCH_ASSOC);

- On Drupal 12 this causes a TypeError:

TypeError: Drupal\Core\Database\Statement\StatementBase::fetchAllAssoc():
Argument #2 ($fetch) must be of type
?Drupal\Core\Database\Statement\FetchAs, int given

Queue::prepareJob() hits this on every enqueue of a job type where allow_duplicates is FALSE. This means unique jobs do not work on Drupal 12.
\Drupal\Core\Database\Statement\FetchAs::Associative works on 10.2, 11, and 12.

Drupal 11 is not affected. 11.4 still declares fetchAllAssoc(string $key, FetchAs|int|null $fetch) and accepts the integer with a deprecation notice. I installed stock 1.7 on 11.4.7 and ran the same path without problems.

Both versions also keep core_version_requirement at ^10.2 || ^11. The module has no drupal/core constraint of its own. Drupal 12 installs still need composer-drupal-lenient.

I am correcting my notes in #5 and #6. I said 1.x-dev covered all three points. That is wrong for the PDO constant. It is unchanged on the dev branch.

relative23’s picture

StatusFileSize
new692 bytes
new4.5 KB
new333 bytes

Obsolete, please ignore this comment. The patches I attached are redundant: the bot patch in #4 already covers the same line with DeprecationHelper::backwardsCompatibleCall(). Files hidden.

relative23’s picture