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:
- 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.
- 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.
- 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
- 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.
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.
| Comment | File | Size | Author |
|---|---|---|---|
| #51 | permissions_by_term-D10-3289053.patch | 15.13 KB | amitvin |
| #46 | interdiff_43-46.txt | 1.21 KB | fathima.asmat |
| #46 | permissions_by_term-D10-compatibility-3289053-46.patch | 13.07 KB | fathima.asmat |
| #43 | permissions_by_term-D10-compatibility-3289053-43.patch | 12.34 KB | _kash_ |
| #43 | interdiff_30_43.txt | 621 bytes | _kash_ |
Issue fork permissions_by_term-3289053
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 by Drupal Rector. Please see the issue summary for more details.
It is important that any automated tests available are run with this patch and that you manually test this patch.
Drupal 10 Compatibility
According to the Upgrade Status module, even with this patch, this module is not yet compatible with Drupal 10.
Currently Drupal Rector, version 0.12.0, cannot fix all Drupal 10 compatibility problems.
This patch does not update the
info.ymlfile for Drupal 10 compatibility.Leaving this issue open, even after committing the current patch, will allow the Project Update Bot to post additional Drupal 10 compatibility fixes as they become available in Drupal Rector.
Debug info
This patch was created using these packages:
Comment #3
project update bot commentedThis is an automated patch generated by Drupal Rector. Please see the issue summary for more details.
It is important that any automated tests available are run with this patch and that you manually test this patch.
Drupal 10 Compatibility
According to the Upgrade Status module, even with this patch, this module is not yet compatible with Drupal 10.
Currently Drupal Rector, version 0.13.0, cannot fix all Drupal 10 compatibility problems.
This patch does not update the
info.ymlfile for Drupal 10 compatibility.Leaving this issue open, even after committing the current patch, will allow the Project Update Bot to post additional Drupal 10 compatibility fixes as they become available in Drupal Rector.
Debug info
This patch was created using these packages:
Comment #4
project update bot commentedThis is an automated patch generated by Drupal Rector. Please see the issue summary for more details.
It is important that any automated tests available are run with this patch and that you manually test this patch.
Drupal 10 Compatibility
According to the Upgrade Status module, even with this patch, this module is not yet compatible with Drupal 10.
Currently Drupal Rector, version 0.13.1, cannot fix all Drupal 10 compatibility problems.
This patch does not update the
info.ymlfile for Drupal 10 compatibility.Leaving this issue open, even after committing the current patch, will allow the Project Update Bot to post additional Drupal 10 compatibility fixes as they become available in Drupal Rector.
Debug info
This patch was created using these packages:
Comment #5
jepster_Currently blocked since there is an issue related to running PHPUnit tests with Drupal 10: https://www.drupal.org/project/drupal/issues/3315351
My temp. changes are in this Git feature branch: https://git.drupalcode.org/project/permissions_by_term/-/tree/3289053-dr...
Comment #6
mmjvb commentedSetting it to Postponed sabotages the bot. It currently doesn't consider the module D10 compatible, addition fixes are to be expected. Sounds like you reviewed the proposed refactoring, suggest to allow for further fixes by setting to Active.
Comment #7
jepster_Comment #8
project update bot commentedUpdating bot issue summary.See #3313904: Update project bot templates for RTBC status support and human interaction tips
Comment #9
anybodyDrupal 10 is out.
Comment #10
ressaThe maintainer currently has not enough time to work on this amazing module: #3316032: Searching for co-maintainers.
Comment #11
kristen pol@Peter Majmesku #3315351: How to run PHPUnit tests with Drupal 10? is fixed now in case you didn't see yet. Thanks.
Comment #12
niko- commentedComment #13
anybodyComment #14
anybody@mmjvb, @ressa, @Kristen Pol would someone of you like to Co-Maintain the project perhaps?
I already have too many projects maintainerships, so I can't add this large one. ~5.000 sites use this module, so it's sad to see there's no D10 compatibility.
Comment #15
ressaThank you @Anybody, for all the great work you and your colleagues do maintaining modules, such as CAPTCHA and Riddler. It's greatly appreciated, and I totally understand if you don't have the ressources for another module. Sadly, my coding skills are too limited to maintain the module, but I have added it on #3342443: META: Adopt contributed projects for Drupal 10 readiness, so maybe someone will volunteer?
Comment #16
heddn@ressa added to the spreadsheet.
Comment #17
ressaThanks @heddn.
Comment #18
amber himes matzHere's an interdiff between the patches in #4 and #12 as they have the same name and no interdiff was posted in #12.
Comment #19
megakeegman commentedComment #20
megakeegman commentedI applied patch #12 to a fresh D10 install and upon enabling the module encountered an unexpected error:
WARNING: [pool www] child 2054 said into stderr: "NOTICE: PHP message: Uncaught PHP Exception Error: "Call to undefined method Symfony\Component\HttpKernel\Event\RequestEvent::isMasterRequest()" at /var/www/html/web/modules/contrib/permissions_by_term/src/Listener/KernelEventListener.php line 81"Additionally the submodule, permissions by entity, has not had any automatically generated updates for D10 and will also require some work.
Comment #21
megakeegman commentedFixed a small deprecated function call, configured the module, and then went to add a new article, and encountered the following unexpected error:
Too few arguments to function Twig\Environment::loadTemplate(), 1 passed in /var/www/html/web/modules/contrib/permissions_by_term/src/Service/NodeEntityBundleInfo.php on line 89 and at least 2 expectedComment #22
niko- commentedpatch #21 against 3.1.21.
Message
Too few arguments to function Twig\Environment::loadTemplate(), 1 passed in /var/www/html/web/modules/contrib/permissions_by_term/src/Service/NodeEntityBundleInfo.php on line 89 and at least 2 expectednot related to drupal 10. loadTemplate is internal methodComment #23
anybodyDue to the maintainer inactivity and blocking D10 upgrade I'm unsure about the future of this module and the other open issues.
So I decided to switch over to entity_access_by_role_field which is Drupal 10 compatible and has a more direct logic. Due to this different logic, this might not be the right replacement for everyone here, but perhaps in some cases it's a good or better choice, if you were using permissions_by_term more as a workaround, like in my case.
Still, I think Drupal 10 compatibility would be super important here due to the very many users.
Comment #24
jepster_I am the maintainer of the Permissions by Term module. I do not have an ongoing project, which gathers value from this module. I was working on this module for a long time and did enough. If you like to have Drupal 10 compatibility, feel free to contribute: https://www.drupal.org/project/permissions_by_term/issues/3316032
Comment #25
niko- commented@Peter Majmesku I can help with module
Comment #26
jepster_@niko: Nice! Feel free to work on the existing patches. You can share your updated patch here and if it's tested, we can create an new release.
Comment #27
jepster_@niko: Do you have everything to solve this issue?
Comment #28
niko- commented@Peter, yep tnx
Comment #29
ressaAdding project name in title.
Comment #30
sudesh.solaskar@peter I have updated few fixes that where shown by the upgrade status module.
Comment #31
sudesh.solaskarComment #32
jepster_@sudesh.solaskar: Thanks. Do you think that the D10 upgrade patch is ready or do you see issues?
Comment #33
sudesh.solaskar@peter I think based on the reports of upgrade status all of the D10 compatibility issues are fixed.
Comment #34
jepster_Great, sudesh.solaskar. Could anybody with an ongoing project please test the recent D10 patch?
Comment #35
Anonymous (not verified) commentedTest for 3289053-30.patch
Comment #36
sudesh.solaskar@erdm, can you confirm on which version of this module you are trying to apply the patch. As 3.1.21 already has core version requirement set to ^9 || ^10
Comment #37
Anonymous (not verified) commented@sudesh
PbT Test version: 3.1.21
Drupal version : 10.0.7
Test PbT module info.yml
Comment #38
_kash_ commented3.1.21 does looks like it only has ^9 not ^10
https://git.drupalcode.org/project/permissions_by_term/-/blob/3.1.21/per...
Comment #39
_kash_ commentedThis patch looks to have trouble applying because the packaging script alters the info file. Likely this issue : https://www.drupal.org/project/drupal/issues/3036459
I was able to work around it and get the patch to apply cleanly with this
https://www.drupal.org/project/drupal/issues/3036459#comment-13851631
https://getcomposer.org/doc/06-config.md#preferred-install
Comment #40
jepster_@_KASH_: That looks weird. If a patch can be applied via Git, it should be applicable by Composer without any extra config. Which error do you get without this Composer extra-config? And why this extra-config is necessary?
Comment #41
_kash_ commentedI get this error https://www.drupal.org/project/permissions_by_term/issues/3289053#commen...
Notice that the code in the git repo is NOT that code that ends up in the project prior to the patch being applied.
This is the git repo code https://git.drupalcode.org/project/permissions_by_term/-/blob/3.1.21/per...
This is what the patch is trying to apply against https://www.drupal.org/project/permissions_by_term/issues/3289053#commen...
Read the links in my prior post for a better understanding.
Comment #42
_kash_ commentedAfter applying the patch I am seeing this error on the node edit page:
Running 10.0.7
Comment #43
_kash_ commentedHere is an updated patch that fixes the error on the node edit page. Seems like the function loadTemplate() NodeEntityBundleInfo.php line 89 should be removed/replaced as it is marked @internal. However this change seems to work.
Comment #44
larowlanAll the changes here make sense, there's just a minor whitespace issue that will likely impact coding standards fails
there's some whitespace issues here
Comment #45
kristen polThanks, moving back to needs work for the minor formatting fix.
Comment #46
fathima.asmat commentedHere is an updated patch for the formatting issue and the
info.ymlcompatibility for the sub modulepermissions_by_entity.The patch applies cleanly on D9.5 and D10 as well,
upgrade_statusseems happy just with a flag for SymfonyHttpKernelInterface::MASTER_REQUESTwhich can't be replaced to useHttpKernelInterface::MAIN_REQUESTyet as the module has to support D9.5 as well.Comment #47
fathima.asmat commentedComment #48
larowlanThis looks good to commit in my book, I can't see anything there that will cause regressions for sites on 9.x, so this should be good to commit and queue tests
Comment #49
kristen polNote that @fathima.asmat and others have been given co-maintainership per #3316032: Searching for co-maintainers so hopefully they can help get this merged in with our support.
Comment #50
fathima.asmat commentedThanks Larowlan and Kristen +1. I'm happy to commit this to Git and will need help creating a release for it as I don't have permissions for it.
I just tested my git push access to the repo and it seems like it's working, https://git.drupalcode.org/project/permissions_by_term/-/tree/d10-compat....
Comment #51
amitvin commentedI am not able to apply patch #46 with 9.5.7, may be because I have multiple patch applied for this module. I tried to improve on patch #22 and #43. Tested it without applying other patch, it works.
Comment #52
fathima.asmat commented@amitvin, what issues were you having while applying the patch? Could you add the interdiff for the patch you created so that it would be easy to view the changes that you have made with the patch, there is some guidance here about interdiff in case it's useful, https://www.drupal.org/node/1488712.
The patch #51 though enforces
HttpKernelInterface::MAIN_REQUESTthat can't still be replaced forHttpKernelInterface::MASTER_REQUESTasMAIN_REQUESTconstant is only supported by Drupal 10 but not D9. To keep the module compatible for both D9 and D10, we should retainHttpKernelInterface::MASTER_REQUEST. This would not be a problem for D10 still as the constant will not be dropped by Symfony until version 7.Comment #54
fathima.asmat commentedSo as majority suggested, I have merged the patch to dev branch and committed a tag 3.1.22. I will speak to Kristen Pol and get a module release out as I don't have enough permissions to do that. Thanks to everyone who contributed with this +1.
Comment #56
fathima.asmat commentedComment #57
fathima.asmat commentedComment #58
fathima.asmat commentedComment #59
fathima.asmat commentedComment #60
fathima.asmat commentedA new issue is created to create a project release for the new tag, https://www.drupal.org/project/permissions_by_term/issues/3353813
Comment #61
fathima.asmat commentedThere is a new release for D10 compatibility - https://www.drupal.org/project/permissions_by_term/releases/3.1.22.
Comment #62
wheelercreek commentedOn Drupal 9.5.7 with the new release (3.1.22) I'm getting this error when I attempt to create or edit content:
Twig\Error\LoaderError: Template "__TwigTemplate_1204b7436b150da256126149d5547692" is not defined. in Twig\Loader\ChainLoader->getCacheKey() (line 98 of /code/vendor/twig/twig/src/Loader/ChainLoader.php)
I had to roll back to 3.1.21 and that seems to be working.
This issue is also reported here:
https://www.drupal.org/project/permissions_by_term/issues/3354478
Comment #63
kristen polThanks for the bug report. Would you please open a new issue and cross link them?