Problem/Motivation

Having Quick Node Clone and Group module enabled, I get the following WSOD error on any page:

Error: Class "Drupal\group\Entity\GroupContent" not found in _quick_node_clone_has_clone_permission() (Line 87 in /web/modules/contrib/quick_node_clone/quick_node_clone.module)

#0 /web/modules/contrib/quick_node_clone/src/Controller/QuickNodeCloneNodeAccess.php(29): _quick_node_clone_has_clone_permission()

This is an issue for anyone using a recommended stable release of Group module.

Steps to reproduce

  1. Install and configure the "Group" module >=2.0
  2. Install and configure Quick Node Clone 8.x-1.x
  3. Visit manage content at /admin/content or view any node - e.g., front page

Proposed resolution

Fix references to any deprecated class removed by Group 2.0 or Group 3.0.

Consider deprecating support for older versions of Group that are no longer recommended by the maintainer.

Remaining tasks

Consider implementing hook_requirements() to warn users who have Group 1.0 that support will be (or has been) deprecated.

Update release notes if Group 1.0 support is deprecated.

User interface changes

API changes

Data model changes

Command icon 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:

  • 8.x-1.x Comparecompare
  • 3352168-conflict-with-group Comparecompare

Comments

Anybody created an issue. See original summary.

anybody’s picture

Title: Conflict with "Group" module » Conflict with "Group Node" module (Group 3.x)
Issue summary: View changes

Okay I think I finally found the reason:

Quick node clone uses:

if (\Drupal::moduleHandler()->moduleExists('gnode')) {
      $group_contents = GroupContent::loadByEntity($node);
     [...]

in the module file.

The use statement:

use Drupal\group\Entity\GroupContent;

exists, but Group 3.x doesn't seem to have the Drupal\group\Entity\GroupContent class anymore!

So this needs an update. I see the following options:
a) Put "Quick Node Clone Group" into a submodule and define concrete version dependencies there
b) Add an if statement to check, if the class exists and thereby change the implementation
c) ...?

lpeidro’s picture

Assigned: Unassigned » lpeidro

I try to create a patch that fix the incompatibility with Group v2 and v3.

lpeidro’s picture

Status: Active » Needs review
StatusFileSize
new7.95 KB

I have push a possible solution where check when is necessary the version of module Group, and depending on the version a certain piece of code is execute with a control structure.

There is a new class, with static methods as helper.

The code has been pushed to the branch "8.x-1.x" of this force, I am not sure if it is ok use that branch.

I upload a patch file to apply the fix to text.

Thanks.

lpeidro’s picture

I do not know why but the test system has problems to apply the patch. I local and in our CI works and the error "fatal: git apply: bad git-diff - expected /dev/null on line 135" has no sense, so int he line 135 "dev/null" is.

I will try to fix it.

lpeidro’s picture

StatusFileSize
new7.88 KB

I upload a new version of the patch, only remove some metainfo of the patch generated by PhpStorm.

lpeidro’s picture

Assigned: lpeidro » Unassigned
monaw’s picture

i got the same error and the quick-node-clone-3352168-groups-v2.patch above fixed my error, thank you so much! i'm using Quick Node Clone 8.x-1.16 and Drupal 9.5.9

sergiur’s picture

we're experiencing the same issue, the patch in #6 fixes it. thank you!

chop’s picture

This is a problem for anyone using Group v2.x or Group v3.x

Group v1.x is no longer recommended.

An upgrade path exists from Group v1.x to Group v2.x.

New sites will often install Group v3.x.

Consider removing Group v1.x support entirely.

You're in a sticky situation by having this integration code but no real way to tie it to a specific version of Group. The idea of moving this integration code out into a submodule with defined dependencies and version constraints makes some sense.

chop’s picture

Title: Conflict with "Group Node" module (Group 3.x) » Group module - Error: Class Drupal\group\Entity\GroupContent not found
Version: 8.x-1.16 » 8.x-1.x-dev
Issue summary: View changes
mjmorley’s picture

This is a duplicate of https://www.drupal.org/project/quick_node_clone/issues/3306677.
Patch #5 from that issue fixes the problem and I think is a nicer solution than the one here in this issue. I think there needs to be some discussion about which approach is better and to close the relevant ticket.

kksandr’s picture

Status: Needs review » Closed (duplicate)

I think this question should be closed as a duplicate in order to concentrate all efforts on one thing.

  • In issue #3306677, all patches are already posted as merge requests, allowing for automated testing.
  • In the same patch I see the use of the extension.list.module service to determine the version of the group module, but this service is still considered internal and it may change (#2940481).