Download & Extend

subuser_load_all not returning the proper parent user ids and not returning userids if we have defined another relation

Project:Subuser
Version:7.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

Two problems in subuser_load_all:

  1. If we set the children argument to FALSE to check get the parent user for a subuser we get the user id of the subuser itself. This is because we need to take the value from the other endpoint.
  2. If we have more than one relation in the system where the enpoint user is allowed, for example a 'node -> belongs_to -> user', subuser_load_all would return also the node ids in the $user array.

I attach a patch right away, as I got an issue number.

Comments

#1

Status:active» needs review

Patch attached...

AttachmentSize
subuser-subuser_load_all_fix-1256938-1.patch 2.45 KB

#2

Implemented caching using drupal_static() - because with #1213566: Add View/Edit/Delete Functionality, it can be called more than twice for the same account.

AttachmentSize
subuser-loadall-1256938-2.patch 1.24 KB