Opened 2 years ago
Closed 2 years ago
#2897 closed Defect (worksforme)
Loading an ElggAnntation by ID breaks ->name and ->value
| Reported by: | brettp | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Elgg 1.7.8 |
| Component: | Core | Version: | 1.7 |
| Severity: | minor | Keywords: | |
| Cc: | brett@… | Difficulty: | easy |
Description
In get_annotations() ElggAnnotation() is called by passing a database result object which includes name and value because of the select. ElggAnnotation's construct loads everything from the object into the attributes array. If name and value aren't there, ->name and ->value return null, even if it's loaded a real annotation.
Change History (1)
comment:1 Changed 2 years ago by cash
- Resolution set to worksforme
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.

$annotation = new ElggAnnotation($id) calls get_annotation() which does a db query and calls row_to_elggannotation() which returns the database result object. Worked fine in my test.