Ticket #1165 (closed unconfirmed defect: worksforme)

Opened 7 months ago

Last modified 4 months ago

get_entities_from_relationships doesn't work with 'group' subtype.

Reported by: jirwin Owned by:
Priority: high Milestone:
Component: Core Version: 1.5
Severity: major Keywords:
Cc: marcus, brettp, dave

Description

I've extended ElggGroup? to make my own group class, along with subtyping the group entity. Since we don't want groups and our new subtype to always be listed together, we have used the 'group' subtype to be sure to only get non-subtyped group entities when specifically looking at groups.

This works perfectly when using:

list_entities('group',"group", 0, $limit, false);

or:

list_entities_from_metadata('tags',$tag,'group',"group","", $limit, false);

but fails when we try to do:

get_entities_from_relationship('member', $owner, false, "group", "group", 0, "", $number, 0, false, 0);

Failure is indicated by Elgg retrieving all group entities, as opposed to the expected behavior of only group entities with no subtype.

After further examination, get_entities_from_relationship() from relationships.php returns 0 for the subtype when you specify 'group' as the subtype, which is what I would expect it to return. Perhaps a problem with the query generation?

Change History

Changed 4 months ago by cash

  • status changed from new to closed
  • resolution set to worksforme

Actually get_entities_from_relationship() was the only one working as it should. The other two functions had bugs that were letting you do what you were doing. Those have now been fixed.

To separate your two types of groups, the best bet is to add a subtype to the standard groups.

Note: See TracTickets for help on using tickets.