Problem/Motivation
The regular Group module has support for Drupal 10, but the Subgroup module does not.
Here it would be good if we could enable support for Drupal 10 as well.
Most installations still run with version 1, an update to 2.x is often not possible, because in other group projects no update is available yet. So we will probably stay with Subgroup 1.x for a while, but at the moment it is not possible to update to Drupal 10.
The restriction in composer.json is actually done quickly and without problems, but update status still gives out the following things that should be fixed.
modules/contrib/subgroup/src/Event/GroupLeafEvent.php 13
Class Drupal\subgroup\Event\GroupLeafEvent extends deprecated class Symfony\Component\EventDispatcher\Event: since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead
modules/contrib/subgroup/src/Event/GroupTypeLeafEvent.php 13
Class Drupal\subgroup\Event\GroupTypeLeafEvent extends deprecated class Symfony\Component\EventDispatcher\Event: since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead
modules/contrib/subgroup/src/Form/SubgroupSettingsForm.php 262
Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or FALSE to specify whether access should be checked.
modules/contrib/subgroup/src/Form/SubgroupSettingsForm.php 569
Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or FALSE to specify whether access should be checked.
modules/contrib/subgroup/tests/src/Kernel/GroupViewTest.php 112
Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or FALSE to specify whether access should be checked.
modules/contrib/subgroup/subgroup.info.yml 0
Value of core_version_requirement: ^8.8 || ^9 is not compatible with the next major version of Drupal core. See https://drupal.org/node/3070687..
Steps to reproduce
Proposed resolution
* Provide patch or new release
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | subgroup-3347570-21.patch | 20.08 KB | kristiaanvandeneynde |
Issue fork subgroup-3347570
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:
- 3347570-compatibility-for-drupal
compare
- 1.0.x
changes, plain diff MR !6
Comments
Comment #3
ranjit1032002Created a Patch for the issue mentioned, please review.
Thank you
Comment #4
zcht commentedthe patch is not complete, see my description holistic.
Comment #5
jan-e commentedI totally agree with you that we should fix the D10 compatibility for Subgroup 1.x. Are you working on a patch?
Comment #6
zcht commentedMy dev skills are not that strong, I could try it. I'm just not sure with the stuff about entity queries if I would get it changed properly.
Comment #9
shivam_tiwari commentedComment #10
kristiaanvandeneyndeSubgroup 1 targets Group 1, which is not getting any more D10 love from my end, see #3278740-25: D10 compatibility. I would imagine treating Subgroup 1 the same way: If anyone provides patches that work well, I might commit them, but I'd need some +1s from people who can truly vouch the code looks good. #6 does not give me a lot of confidence in that regard :)
Comment #11
zcht commentedThe MR for compatibility already goes in the right direction, however, this is buggy, at the moment in no case use in productive environment. The patch itself applied clean and everything works as it should, existing subgroups can be edited/updated/displayed. BUT: as soon as a new subgroup is created an extremely ugly error occurs. Subgroups are created, but not linked to the group, here the logic is completely broken. Thus linked node types cannot be inserted into the subgroup or other entities.
On closer analysis I found that after the patch no relationships are created for
subgroup_depth, subgroup_left, subgroup_right, subgroup_tree. The logic for this seems to be completely missing. On further analysis and testing, I also get error messages when new entities are added to the subgroup.My setup consists of Drupal 9.5.9, PHP 8.1, Group 1.5 and Subgroup 1.0.2
Comment #12
zcht commentedHave now created the first patch that works for me. No errors are thrown, subgroups can be edited and created. Fixed minor coding standards, set minimum group version to 1.5, declared Drupal 9.5 as minimum version. Tested under PHP 8.1, Drupal 9.5.9 & Drupal 10.x
Feedback and testing would be appreciated.
Comment #13
zcht commentedUnfortunately, the patch with the adjustments for coding standards collides with the important patch #3281672
The patch of @Jan-E I see as mandatory for the next release of Subgroup. So here is the minimum version for compatibility for Drupal 10.
Comment #14
zcht commentedComment #15
jan-e commentedI will take a look at it next week.
Comment #16
jan-e commentedAdded related issue for the Group 8.x-1.x branch.
Comment #17
zcht commentedPatch rerolled, on closer testing it was noticed that in the subgroup.module the statement for $event_dispatcher was in the wrong order and led to a fatal error under Drupal 10 when creating or updating a subgroup.
Comment #18
zcht commentedAlso here, found some more. Existing accessCheck should NOT be changed, patch reroled.
Comment #19
jan-e commentedGroup 8.x-1.6 added support for D10 now. How about Subgroup?
Comment #20
kristiaanvandeneyndeI can see how much of the budget for the new Group release is left and perhaps use that here. Would need to find some time to figure that out.
Comment #21
kristiaanvandeneyndeRemoving credit from low-effort merge requests, adding updated tests and accessCheck(FALSE) on config entity queries.
Comment #23
jan-e commentedThanks a lot! For a final Subgroup 1.x release the fix for doAddLeaf & doRemoveLeaf: timestamp bug and scalability should be merged in the 1.0.x branch as well. You only merged that fix into the 2.0.x and 3.0.x branches as far as I know.
Comment #24
kristiaanvandeneyndeI'm not too fond of being told what I should do as a maintainer. I've got some budget left so I'll see what I can do.
Comment #26
jan-e commentedSorry. I should have asked you if that could be done as well. And it was a reminder to my self that that fix was not in the 1.0.x branch yet.
Comment #29
kristiaanvandeneyndeTurns out this was also needed for v2 and v3, but because we didn't have D10 tests it never showed up.
Comment #30
kristiaanvandeneyndeRe #26 no worries and thanks for working on the other issue. It's just that as a maintainer you get a lot of people telling you what to do without helping out at all. You clearly do help out, so I appreciate the help and apologize if I came across a bit blunt.