#2632 closed Defect (fixed)
Documentation incorrect for get_metadata_byname
| Reported by: | dannyl | Owned by: | cash |
|---|---|---|---|
| Priority: | normal | Milestone: | Elgg 1.7.5 |
| Component: | Core | Version: | 1.7 |
| Severity: | minor | Keywords: | |
| Cc: | brettp | Difficulty: | trivial |
Description
It seems that under some conditions the metadata does not update.
See the below code - when we initially increment the metadata it's good. Then when we increment a counter and reset the metadata the update does not happen.
$n = get_metadata_byname($user_guid, 'unread');
$user = get_entity($user_guid);
$user->unread = n =
if (!$n) {
$user->unread = 0;
$n = 0;
$user->unread = 0 n = 0
}
$n += 1;
$user->unread = $n;
$user->unread = 0 n = 1
Attachments (1)
Change History (6)
Changed 3 years ago by dannyl
comment:1 Changed 3 years ago by dannyl
comment:2 Changed 3 years ago by cash
- Difficulty set to trivial
- Milestone changed from Needs Review to Elgg 1.7.5
- Owner set to cash
- Severity changed from blocker to minor
- Summary changed from Metadata update not working? to Documentation incorrect for get_metadata_byname
comment:3 Changed 3 years ago by cash
- Resolution set to fixed
- Status changed from new to closed
(In [svn:7272]) Fixes #2632 - documentation was incorrect for get_metadata_byname - it does not return a metadata value
comment:4 Changed 3 years ago by cash
(In [svn:7273]) Refs #2632 - cleaned up documentation on metadata
comment:5 Changed 3 years ago by dannyl
Thanks
Note: See
TracTickets for help on using
tickets.

I apologize for the crummy formatting of the ticket - my bad. I've attached the sample code