Problem/Motivation
Running Group Content Moderation 1.0.0-beta2 with Group 8.x-1.5. Wish to upgrade Group module to 2.00-beta3 which has fix to resolve this issue: https://www.drupal.org/project/group/issues/3294949
Apparently, Group Content Moderation is one of the modules preventing the upgrade.
Steps to reproduce
I enter:
composer require 'drupal/group:^2.0@beta' --with-all-dependencies
Which results in:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- drupal/gcontent_moderation is locked to version 1.0.0-beta2 and an update of this package was not requested.
- drupal/gcontent_moderation 1.0.0-beta2 requires drupal/group ^1.0 -> found drupal/group[1.0.0-beta1, ..., 1.5.0] but it conflicts with your root composer.json require (^2.0@beta).
Problem 2
- drupal/group[2.0.0-beta1, ..., 2.0.0-beta3] require drupal/flexible_permissions ^1.0 -> found drupal/flexible_permissions[dev-1.0.x, 1.0.0-beta1, 1.0.x-dev (alias of dev-1.0.x)] but it does not match your minimum-stability.
- Root composer.json requires drupal/group ^2.0@beta -> satisfiable by drupal/group[2.0.0-beta1, 2.0.0-beta2, 2.0.0-beta3].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.Proposed resolution
I am using "--with-all-dependencies" but still getting upgrade failed. Need to know if current Group Content Moderation 1.0.0-beta2 is compatible with Group 2.00-beta3 before proceeding. And, if not, what is path to achieve that compatibility?
| Comment | File | Size | Author |
|---|---|---|---|
| #28 | interdiff_25-27.txt | 298 bytes | dabbor |
| #28 | 3309542-27-group-2.x-compatibility+d10-compatibility.patch | 16.55 KB | dabbor |
| #26 | 3309542-26-group-2.x-compatability-update.patch | 11.87 KB | dabbor |
| #25 | interdiff_22-25.txt | 5.01 KB | dabbor |
| #25 | 3309542-25-group-2.x-compatibility+d10-compatibility.patch | 16.55 KB | dabbor |
Issue fork gcontent_moderation-3309542
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
somebodysysop commentedActually, let me simplify the question: This module is currently preventing me from upgrading Group to 2.0.0-beta3. I need this module and Group, so how do I resolve these issues:
Comment #3
shelaneI downloaded the module manually to test its compatibility. I was immediately met with a WSOD error:
Group 2 and 3 significantly changed the permissions model, so this module will have some work to do in order to be compatible.
Comment #4
shelaneThis documents the API changes: https://www.drupal.org/docs/contributed-modules/group/updating-your-modu...
Comment #6
jrglasgow commentedhere is my first attempt to get this module working with Group 2.x... it doesn't cause any errors on my local at the moment, haven't tested the functionality yet.
Comment #8
jrglasgow commentedfound a problem with the last patch
Comment #10
dylan donkersgoed commentedI added some logic to switch the entity machine names depending on which one is available. This seems to be all that's needed to make it work for 3.x as well.
I did some quick testing of the functionality and I see to be able to, e.g., have one user create a draft and then another user find and publish it. I tested in 3.x. I assume this would work in 2.x as well since I didn't change anything else and as I understand it the APIs are the same, but you may still want to check it yourself.
Comment #11
le72Cool!
Any chances to see it merged?
Comment #12
le72Comment #13
le72I guess the new version of the module should be created. The current version should continue to support Groups 1.x (and maybe 2.x)
The new version for Groups 3.x.
Comment #14
andras_szilagyi commentedTested this with group 2.0.0-rc2 and the patch works as expected.
Comment #15
kingdutchThis was RTBC in #12 but I don't quite understand the changes that were added in #14 where another branch was merged into this one. The work that was added there has not been reviewed yet. Maybe jrglasgow can add some commentary to the changes that where added there to aid in review?
Comment #16
andras_szilagyi commentedI've created a patch without the changes from #14, I see some d10 related stuff, doesn't make any sense to me.
Comment #17
ben_drupal commentedJust wondering when this patch will be merged? Can't wait to use it! Thanks a lot for everybody's work on it.
Comment #18
pcate commentedI tested patch #16 with Group v2.1.0. The patch wouldn't apply for me with composer, but manually applying the patch with git worked. Once applied the content moderation functional worked with my testing. Setting to RTBC.
Comment #19
dabbor commentedIt would be good to get the patch merged as it is not exactly easy to properly manage the module via composer when using Group 2.x and this patch from #16: https://www.drupal.org/project/gcontent_moderation/issues/3309542#commen... though you will most likely need to create a new branch compatible with Group 2.x.
The problem is that composer is looking into modules's composer.json for requirements before the patch is applied to switch requirements from Group 1.x to Group 2.x.
I had to use the following workaround inspired by StackOverflow: Is it possible to ignore child dependencies in Composer config? https://stackoverflow.com/a/53970732
I'm not sure yet about the bit:
it might need to get removed.
Comment #20
mmenavas commentedTested MR #5, and it works well with Group 3.x and Drupal 9.5.x. I recommend merging this MR on a new major version (e.g. 2.x) which will be compatible with Group 2.x and 3.x. The 1.x version can still be maintained to support sites using Group 1.x.
Comment #21
brt commentedI agree with mmenavas #20
It's hard to test and provide feedback without this being merged
Comment #22
dabbor commentedFollowing the information from Updating your modules to Group 2.0 API "Database structure" section https://www.drupal.org/docs/contributed-modules/group/updating-your-modu... , the
group_content_field_datamust be replaced withgroup_relationship_field_dataand the current patch from #16 is missing it.The table name must be replaced in Views sql JOIN's aliases as well, e.g.
group_relationship_field_data_node_field_data. Example of such Views LEFT JOIN:I'm attaching a patch that adds the required change on top of the patch from #16.
Comment #23
dabbor commentedComment #24
dabbor commentedFollowing the conversation above I agree with #20:
I believe it's clear this module must support (move to) Group 2.x / 3.x for the following reasons:
8.x-1.xversion of Group receives only Security fixes.8.x-1.xversion info file states it is compatible with Drupal 10 (https://git.drupalcode.org/project/group/-/blob/8.x-1.x/group.info.yml), the description of the project page states otherwise:Branch | Core support | Status
8.x-1.x | Drupal 8 / 9 | Security fixes only
1.x-dev#46bd24592should get release soon, are not compatible with the patch here (we will have to update it here anyway if we are not getting a separate 2.x branch (stream) for it.Please, create a new branch 2.x from latest 1.x and merge this patch in.
Comment #25
dabbor commentedI've updated the patch from #22 to include the "Automated Drupal 10 compatibility fixes" from https://www.drupal.org/project/gcontent_moderation/issues/3297291 making it possible to run
gcontent_moderationwith Group 2.x / 3.x on D10.The patch is done against
1.0.0-beta2and NOT the1.x-dev.EDIT: Running
drush upgrade_status:analyze gcontent_moderationI can see some a few small problems to be fixed. I will update the patch soon.Comment #26
dabbor commentedHere's an update patch from #22 that is against
1.x-devand thus D10 compatible.Comment #28
dabbor commentedRunning the
drush upgrade_status:analyze gcontent_moderation(using the https://www.drupal.org/project/upgrade_status contrib to check D10 compatibility), I found:upgrade_statusbug (as mentioned in some comments I found):Comment #29
caesius commentedI'm updating the MR to apply the latest patch since installing this module with the patch is rather difficult with the composer requires on 1.x-dev. Will include instructions for installing directly from the MR after I've done so.
Comment #30
caesius commentedOkay, I think that did it. Please continue development using the MR to make this easier to install, test, and track.
Also @dabbor I noticed your patch restricts to group:^2.0 but the MR was noted as working on Group 3, so I've updated it to ^2.0 || ^3.0.
To install the MR and avoid Composer yelling re: version conflicts, add the following as the first item in the repositories list in composer.json:
Do not forget to remove this later should the MR make it to a stable release or you will end up downloading an old version of 1.x-dev.
Then run the following Composer command:
composer require drupal/gcontent_moderation:dev-3309542-is-group-content#6b6ddc80Note that
#6b6ddc80is the latest commit as of this writing; if the MR updates you should update the commit to that hash after vetting it. Never require a dev branch without pinning to a commit.Comment #31
jrglasgow commentedFYI - until commit 1ac47612 (24 August) This fork was working for my needs for both Group 2.x and Group 3,x... Since commit 1ac47612 it is no longer working for Group 3.x so I have re-opened #3381073: Add compatibility with Group 3.x and basing the solution on this branch, but changing the entity names to match Group 3.x.
Comment #32
caesius commentedOkay, I think I see what the problem is. The latest patches seem to omit some of the logic that was added to determine whether Group is version 2 or 3.
For example, these lines
I assumed the patches were continuing work done in the MR but that doesn't seem to be the case. I'll try carefully rolling back these changes where I find them.
I should note that in some places it doesn't look like we'll be able to easily suss out Group version 2 or 3, such as configuration files here
I'm not sure if the solution should be to release two new major versions of the module targeting Group 2 and 3 separately, or to go through extra effort to use the correct tables and machine names in config.
Comment #33
caesius commentedOkay, I think that should do it. Here are all the changes between the latest version and the March commit to the MR -- the 2.x vs 3.x checks have been reinstated.
These changes technically target 3.x due to the use of
group_relationshipfor table names in .yml files (instead ofgroup_contentper the 3.0.0 CR), but sites using Group 2.x should already be established and likely already using this module with config exported.The biggest problem I see is in this .views.inc file, since I'm not sure how we're supposed to figure out which table name to use.
If this module releases separate 2.x and 3.x branches to handle the differences, then the final commit for this MR should use
group_contentwhere it's not possible to check which one is needed. Then the first and hopefully only deviating commit to 3.x would be to update them togroup_relationship. The module would then otherwise follow Group's model of keeping both 2.x and 3.x identical moving forward with the exception of those few lines of code.Comment #35
naveenvalechaif anyone wants to use this module with the Group 2.x
They can use https://github.com/morpht/gcontent_moderation/tree/2.2.x
Comment #36
bbombachiniEntityTypeManager dependency was added on construct but not on create so I've added that.
Comment #37
naveenvalechaComment #38
naveenvalechaMoving it to the right branch
Comment #39
naveenvalechaI'll commit it once this will be RTBC
Comment #40
abhisekmazumdarI have review the MR. I was able to install the module with the changes.
Comment #42
naveenvalechaPR has been merged to 2.0.x
It will be rolled out in next release.
Thanks everyone.