Hi
In the submit function you're calling relation_create('subuser', $endpoints); however this returns a relation - but does not save it (looking at 7.x-1.0-alpha3 of relation module).
We need to change it to call relation_save on the returned relationship in order for it to work.
Patch attached.

Lee

CommentFileSizeAuthor
subuser-relation-save.patch604 byteslarowlan

Comments

larowlan’s picture

marcusx’s picture

Status: Needs review » Reviewed & tested by the community

Patch applied and creating subusers like a champ now!

djalloway’s picture

Using the latest development version of the Relations module.
Should it be relation_construct() instead of relation_create()?

roderik’s picture

#3: no, relation_construct() doesn't exist anymore.

(Google gives #1337740: relation_create should return relation object which also gives a hint as to why relation_save() might not need to be called at some time in the past, but it does now...)

so RTBC +1.

roderik’s picture

Ahem. Above code, works but the relation is still saved incorrectly... The relation_revision.rid DB field is always set to 0.

The cause is not here, but in the relation module. See #1396678: RID not saved in revision table when new relation is saved.
Until that patch is applied, #1213566: Add View/Edit/Delete Functionality (subuser.module) will not work.

Please note that until #1204692: Change default views to reflect upstream changes to VBO + relation (subuser.module) is updated, you should not use the latest -dev version from relation, since it will break the default view. Instead use relation-7.x-1.0-beta3 with the patch in #1396678: RID not saved in revision table when new relation is saved.

boombatower’s picture

Status: Reviewed & tested by the community » Fixed

Committed thanks.

Status: Fixed » Closed (fixed)

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

  • Commit 0fe2fce on 7.x-2.x, 8.x-1.x by boombatower:
    Issue #1208314 by larowlan: Update relation creation for API changes.