I'm trying to integrate groups with a headless mobile app but cannot seem to get group content to show or save.

Enabling this module produces a couple of REST endpoints:

/group/{group}
/group/{group}/content/{group_content}

If I go to /group/1?_format=json in the browser then it returns the group entity in json format.

If however I go to /group/1/content/1?_format=json It errors out.

Do I assume that entities that reference this group AND users that reference this group (ie members) are both considered content? In my above example 'content/1' refers to a user member.

It produces the error:

Recoverable fatal error: Argument 1 passed to Drupal\rest\Plugin\rest\resource\EntityResource::get() must implement interface Drupal\Core\Entity\EntityInterface, string given in Drupal\rest\Plugin\rest\resource\EntityResource->get() (line 122 of...

I did try debugging the code to but it's just a bit overwhelming right now.

I've also tried paths such as:

/entity/group_content/1
/entity/group_content_type/1
/entity/test_type_group_membership/1 (where test_type-group_membership is the type as defined in 'group_content' table)

etc

Comments

Adam Clarey created an issue. See original summary.

jeremdow’s picture