Problem/Motivation
Hello project maintainers,
This is an automated issue to help make this module compatible with Drupal 11.
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 "ProjectUpdateBotD11" 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:
- 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 "ProjectUpdateBotD11" 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.
- 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 "ProjectUpdateBotD11" 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 "ProjectUpdateBotD11" tag.
- 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 11 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
- Apply the latest patch in the comments by Project Update Bot or human contributors that made it better.
- Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.
- Provide feedback about how the testing went. If you can improve the patch, post an updated patch here.
Using the merge request
- Review the merge request and test it.
- Thoroughly test the changes. These changes are automatically generated so they haven't been tested manually or automatically.
- 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.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | jsonapi_extras.3.x-dev.rector.patch | 9.27 KB | project update bot |
| #17 | interdiff-last-bot.6944363.txt | 707 bytes | project update bot |
| #13 | Screenshot 2024-06-14 at 11.37.52 PM.png | 73.16 KB | ankitv18 |
| #2 | jsonapi_extras.3.x-dev.rector.patch | 8.35 KB | project update bot |
Issue fork jsonapi_extras-3451984
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:
- 3451984-automated-drupal-11
changes, plain diff MR !52
- project-update-bot-only
changes, plain diff MR !50
Comments
Comment #2
project update bot commentedThis 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 11 Compatibility
According to the Upgrade Status module these changes make this module compatible with Drupal 11! 🎉
Therefore these changes update the
info.ymlfile for Drupal 11 compatibility.Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.
Debug information
These packages were used to generate the fixes:
Comment #4
ptmkenny commentedShould the next version require 10.1+ or 9+?
If 10.1+, we should use DI and remove the watchdog function completely, no need for backwards compatibility (since at least 10.1 is needed).
Comment #5
bbralaI think we should do the following:
Release 9/10/11 compatible version
Then start cleaning up for 4.x
But i'm not entirely sure we can do that with these changes:
In principle i don't mind we move to a ^10.1 || ^11 requirement. But i think that would also mean we need to rework some of the ways we change resources. Since we need less custom code for that. I don't have the scope of that ready mentally unfortunately.
Comment #6
ptmkenny commentedOk, let's see how the tests run when we add Drupal 9 to the GitLab CI mix.
I added the UpdateBot changes to the
3451984-automated-drupal-11branch and then enabled Drupal 9 and Drupal 11 testing on GitLab CI.Comment #8
bbralaHmm, think a trailing comma in a function broke 9.x
Comment #10
ankitv18 commented@bbrala as we are supporting D10.1 and D11 then I dropped deprecation helper method as updated the code with Error::logException, also updated the gitlab template to run on previous_minor and next_minor.
for below code in response of #5
public function normalize($object, $format = NULL, array $context = []): array|bool|string|int|float|null|\ArrayObjectI believe drupal core jsonapi normalize method and other methods have these return types
Pipelines are passing now ~ Please review the MR!52.
Comment #11
ankitv18 commented@bbrala PHPunit next major pipeline: https://git.drupalcode.org/issue/jsonapi_extras-3451984/-/jobs/1830197
Do we need to fix this in this issue or open a separate issue?
Comment #12
chandu7929 commented@ankitv18 - I can see issue when enabling this module on Drupal 11.
Comment #13
ankitv18 commentedUpdated the MR and fixes remaining type hint, validated on local by installing the module.

Comment #15
ankitv18 commentedfor phpunit previous major: https://git.drupalcode.org/issue/jsonapi_extras-3451984/-/jobs/1867426#L217 (These are the failing)
Reason: to avoid phpcs issues like this: Drupal.Functions.MultiLineFunctionDeclaration.MissingTrailingComma
There are many places where comma separator is added at the end of closing statement in the constructor (These changes taken place couple of weeks ago).
So do we need that change or we can remove comma separator from those places and add phpcs:ignore Drupal.Functions.MultiLineFunctionDeclaration.MissingTrailingComma above last argument in the method.
cc: @bbrala
Comment #16
ankitv18 commentedNow pipeline is failing on https://git.drupalcode.org/issue/jsonapi_extras-3451984/-/jobs/1867677#L102
So I believe we can't run the tests below D10 cause of return type hint of
public function normalize($object, $format = NULL, array $context = []): array|bool|string|int|float|null|\ArrayObject {Dropping the D9 from info.yml, phpcs:ignore for comma trailing and previous major from gitlab
cc: @bbrala @ptmkenny
Comment #17
project update bot commentedThis 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 11 Compatibility
According to the Upgrade Status module these changes make this module compatible with Drupal 11! 🎉
Therefore these changes update the
info.ymlfile for Drupal 11 compatibility.Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.
Debug information
These packages were used to generate the fixes:
Comment #18
chandu7929 commentedReviewed MR #52 and changes looks good to me, hence RTBC.
Comment #19
japerryIt'd be good if this still supported Drupal 9.5, as there are quite a few sites still on it -- supporting the last major allows people to more easily upgrade to D11 in the future.
public function normalize($object, $format = NULL, array $context = []): array|bool|string|int|float|null|\ArrayObjectWhile this is a hard break from Symfony, Drupal 9.5 is no worse off than 10. The bigger issue here is compatibility with downstream modules. I'm currently working on Schemata, and if I commit a release of that module before this one, JSONAPI extras will WSOD if its not updated first.
So I'd recommend support Drupal 9.5 and getting a release out for this asap.
Comment #20
japerryComment #21
japerryActually D11 tests are failing, So marking NW
Comment #22
bbralaKeeping Drupal 9 support is kinda annoying, not sure how you see that with the return type changes. Those changes were introduced in 10. I could conditionally load imposters, but that feels kinda crap.
Not sure how you see this.
Comment #23
ankitv18 commented@bbrala https://git.drupalcode.org/issue/jsonapi_extras-3451984/-/jobs/1867802#L71 should I fix this in this MR or log a separate issue for that?
Comment #24
japerryChanging back to needs review, I think we're good to go here.
Comment #26
bbralaThanks so much guys for working on this. I've tested the changes locally on 9, 10 and 11. Also tested on a running public api which works perfectly.
Al seems to work as intended. Lovely. Merging and releasing a RC for this