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

marcusx’s picture

Status: Active » Needs review
StatusFileSize
new2.45 KB

Patch attached...

roderik’s picture

StatusFileSize
new1.24 KB

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

boombatower’s picture

Status: Needs review » Fixed

Rewrote quite a bit to make variables clearer. Also, took advantage of ->entityCondition('bundle', 'subuser') instead of if condition in loop. Thanks.

Looks like reload_load() fails currently if you pass it a vid.

boombatower’s picture

StatusFileSize
new2.11 KB

Status: Fixed » Closed (fixed)

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

  • Commit dd806c5 on 7.x-2.x, 8.x-1.x by boombatower:
    Issue #1256938 by marcusx, roderik, and boombatower: Correct...