Problem/Motivation

Adding new media via returns the following error:
Error: Cannot use object of type Drupal\group\Plugin\Group\Relation\GroupRelationType as array in groupmedia_group_relationship_create_access() (line 154 of modules/contrib/groupmedia/groupmedia.module).

Steps to reproduce

1. Fresh D10 install
2. Install group 3.x and groupmedia 4.x
3. Create a new group type
4. Enable the "Group media (Document)" group relationship at /admin/group/types/manage/{group_id}/content using default settings
5. Create a new group using default settings
6. Go to /group/1/media/add and notice the error

Proposed resolution

The plugin definition for a group relationship is not an array, it's an object, instance of GroupRelationTypeInterface. That should be taken into account in function groupmedia_group_relationship_create_access.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#4 after-patch.png199.68 KBarisen
#4 before-patch.png512.06 KBarisen

Issue fork groupmedia-3354258

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:

Comments

alecsmrekar created an issue. See original summary.

alecsmrekar’s picture

Assigned: alecsmrekar » Unassigned
Status: Active » Needs review
arisen’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new512.06 KB
new199.68 KB

Reviewed the MR and applied the patch. The patch applies cleanly.

Checking patch groupmedia.module...
Applied patch groupmedia.module cleanly.

The error is gone after applying the patch. Attached the screenshots.

LOBsTerr made their first commit to this issue’s fork.

  • LOBsTerr committed 238d36bc on 3.0.x
    Issue #3354258 by alecsmrekar, LOBsTerr: Error when trying to add new...
lobsterr’s picture

Status: Reviewed & tested by the community » Fixed

Thank you for your contribution, I will tag a new release

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.