Opened 4 years ago
Closed 4 years ago
#886 closed Defect (fixed)
get_entities_from_relationship returns all subtypes if there isn't any entities with the specific subtype
| Reported by: | mmontesp | Owned by: | brettp |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | Core | Version: | 1.5 |
| Severity: | major | Keywords: | relationships, subtype, bug |
| Cc: | brettp | Difficulty: |
Description
Hi!
get_subtype_id('object','foo') returns 0 if there isn't any entities with subtype 'foo' so, if you try...
get_entities_from_relationship('mycustomrelationship', $guid_one, false, 'object', 'foo');
You will obtain entities with any subtype and relationship 'mycustomrelationship' with $guid_one.
I have fixed it on my ELGG installation replacing...
$subtype = get_subtype_id($type, $subtype);
into...
if ($subtype){
if (!$subtype = get_subtype_id($type, $subtype)) return false;
}
I hope it will help you
Regards!
Change History (5)
comment:1 Changed 4 years ago by brettp
- Owner set to brettp
comment:2 Changed 4 years ago by brettp
- Resolution set to fixed
- Status changed from new to closed
comment:3 Changed 4 years ago by brettp
comment:4 Changed 4 years ago by cash
- Resolution fixed deleted
- Status changed from closed to reopened
Patch has been rolled back in [svn:3462]
comment:5 Changed 4 years ago by cash
- Resolution set to fixed
- Status changed from reopened to closed
Brett's new elgg_get_entities* functions fix this. Those new functions fixed a lot of bugs.
Note: See
TracTickets for help on using
tickets.

Fixed in commit 3360.