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 |
|---|---|---|---|
| #45 | 3455312-and-3520464-45.patch | 907 bytes | joseph.olstad |
| #34 | 3455312-34-automated-drupal-11-compatibility-fixes.patch | 51.47 KB | dabbor |
| #2 | toc_api.1.x-dev.upgrade_status.post_rector.txt | 2.89 KB | project update bot |
| #2 | toc_api.1.x-dev.rector.patch | 1.18 KB | project update bot |
Issue fork toc_api-3455312
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
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, even with these changes, this module is not yet compatible with Drupal 11.
Currently Drupal Rector, version 0.20.3, cannot fix all Drupal 11 compatibility problems.
Therefore, these changes did not update the
info.ymlfile for Drupal 11 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 11 compatibility fixes as they become available in Drupal Rector.
Debug information
These packages were used to generate the fixes:
Comment #7
vladimirausThanks all. Need to fix
Comment #9
joseph.olstadComment #10
joseph.olstadOk, it's as far forward as I can take it, this is probably "good enough" to merge. If someone can improve this then great. I say merge it, and cut an alpha or beta or rc release so that we can avoid doing overrides in our composer for Drupal 11 compatibility.
There's a multitude of fixes here. I fixed:
Prior to these changes there was nothing but failures everywhere.
Comment #11
vladimirausThanks for your contribution @joseph.olstad, but you cannot commit code and review it yourself.
Someone else need to review it and test it.
Comment #12
joseph.olstadI recommend merging this and cutting a 1.6.0-beta1 release so that we can scrap our composer overrides (please!).
All you have to do is merge and tag the 8.x-1.x as 1.6.0-beta1
This way 1.5 stays as the recommended release and we can work on improving 1.6.0 in Drupal 11 without resorting to painful composer overrides that complicate upgrades for those using our distribution of Drupal (WxT).
the drupal ci/cd does the rest.
Comment #14
jurgenhaas@joseph.olstad tests are almost green. There are just 2 phpunit tests that I don't know how to fix. There is 1 about a missing core service, that's confusing. And another 1 is about regex and I don't think we've changed anything there and this must have failed already before.
Could you probably have a look into that? Everything else is resolved.
Comment #15
joseph.olstadYes the missing core service is confusing. And for the regex, these tests were extremely broken prior to this merge request and they have deleted the historical jenkins results so I don't know when this was last working (if ever). This merge request is a vast improvement. With that said, we'll continue to use this merge request and review the results manually. Merging this would be good if we could merge and tag an alpha or beta or rc release for D11 that'd be a step in the right direction.
Comment #16
smulvih2I'm testing this on core 11.1.1, using toc_api from this MR, along with toc_filter 2.3.0. I'm running into an error when saving a node that is using the [toc] token, assume the error is coming from toc_api:
Comment #17
joseph.olstadHmm,
Seems there's smoke in the twig files?
templates/toc-tree.html.twigand
templates/toc-default.html.twigand this
Comment #18
joseph.olstadjurgenhaas, want to take a look?
Comment #19
jurgenhaasI'm not deep into twig, so this is certainly a task for someone else.
Comment #20
joseph.olstadok @jurgenhaas, I'll have to go through the test scenarios manually in my environment. Hopefully some time this week or next week!
Thanks for your work on this!
Comment #21
vladimirausSeems like an issue was fixed in #3487659: TypeError: ..\MetadataBubblingUrlGenerator::generateFromRoute(): Argument #2 ($parameters) must be of type array.
Can you have a look?
Comment #22
vladimirausComment #23
vladimirausComment #24
liam morlandRe "these tests were extremely broken prior to this merge request": The current merge request adds the
.gitlab-ci.ymlfile. I suggest committing #3384686: Add testing configuration. This adds.gitlab-ci.ymland gets the tests passing. Use that issue to get tests passing and then ensure that they keep passing in the current issue.Comment #25
vladimirausNeed work based on CI.
Comment #27
danrodI am looking at the PHPSTAN issues, is the
disabledTestRender()test method really needed?tests/src/Kernel/TocManagerTest.phpComment #28
danrodI fixed all of the PHPSTAN / PHPCS issues that were popping up in the tests/ directory, I ran the tests and they all passed now, I'm not familiar with ths module so I'll need to check if I broke other components of the module by fixing this:
I am aware that they are other issues other than the CI messages and the test directory, for now I am moving this to "Needs Review"
Comment #29
danrodComment #30
joseph.olstad@danrod, great work, fixing the phpstan issues appears to have also fixed the automated tests. 33 tests pass.
Comment #31
dabbor commentedHi everyone and thank you for your effort.
I'm trying to use patch from the MR: https://git.drupalcode.org/project/toc_api/-/merge_requests/16 but for some reason not having luck, getting conflicts (can not be applied). EDIT: Patch I tried to apply: https://git.drupalcode.org/project/toc_api/-/merge_requests/16.patch
I tried the following branches as base:
- 8.x-1.7 (meaning
8.x-1.xbranch with tag8.x-1.7)- 2.0.x-dev#89c0b377 using the latest commit hash (meaning
2.0.xbranch with commit hash89c0b377). This seems to be having the same tag8.x-1.7as the8.x-1.xbranch has (which is confusing).I git-cloned the MR branch and made the patch manually from branch
3455312-drupal11-fixesagainst branch8.x-1.xas base. The2.0.xbranch does not exists in the MR request issue repository (not being up to date with the original).- The patch did not work and I got conflicts to resolve.
- I can see that the MR started on version 1.5 or so and then the conflicts were resolved (merged back) for: 1.6 and 1.7. But maybe something went wrong with the merge conflicts resolutions, I do know exactly.
I appreciate any advice on getting this MR into patch that I can apply to toc_api contrib.
Comment #32
joseph.olstad@dabbor , sometimes you'll get better results using the diff instead of the patch, especially if you're doing a
--dry-runtest of it.https://git.drupalcode.org/project/toc_api/-/merge_requests/16.diff
I just did a dry run of the diff against 2.0.x, and it's 100% clean.
A full apply of the diff works just as expected
Remember, you have to patch against the HEAD of 2.0.x, meaning, you need the latest 2.0.x, so get the latest before you try applying the patch.
Comment #33
dabbor commentedHi @joseph.olstad,
Thank you very much for your advice, I'm happy to learn something new :)
I believe I understood the difference. The patch includes history of the commits and its application tries to do something like git merge while the diff provides just the differences which can be applied without any knowledge of commits or processes that led to the point.
The https://git.drupalcode.org/project/toc_api/-/merge_requests/16.diff works for me, so I'm adding a static patch file from it for referencing in composer (to have a static input that is not changing with the MR updates).
Comment #34
dabbor commentedIt seems that while saving the https://git.drupalcode.org/project/toc_api/-/merge_requests/16.diff as a static patch I made a mistake copy pasting it into the file instead of savign the https://git.drupalcode.org/project/toc_api/-/merge_requests/16.diff from browser and as such I misses some character encoding or so making the previous patch not working so I'm replacing it now.
Comment #35
smulvih2Ok all tests are now passing, functionally toc_api works as expected from my testing. This is ready for review and a new tagged release!
Comment #36
danrodYes !
Is there any chance to reach out to the maintainers for a tagged release?
Comment #37
joseph.olstadWe need this merged and a release tagged asap, this is a release blocker for our distribution and we're looking to publish our Drupal 11 release in the next week or two at the latest!
Comment #39
joseph.olstadMerging
Comment #40
joseph.olstadCreditting
Comment #41
joseph.olstadhttps://www.drupal.org/project/toc_api/releases/2.0.0
Comment #42
joseph.olstadChecking crediting system.
Comment #43
joseph.olstadComment #45
joseph.olstadpatch for toc_filter
Comment #46
joseph.olstadFor comment #45
#3518549: Make TocFilterBlock::blockAccess() return type be compatible with parent
and
#3520464: Layout builder fatal error