#2490 closed Defect (fixed)
isset() on an ElggEntity attribute always return true on unsaved entity
| Reported by: | brettp | Owned by: | ewinslow |
|---|---|---|---|
| Priority: | normal | Milestone: | Elgg 1.8.0 |
| Component: | Core | Version: | 1.7 |
| Severity: | minor | Keywords: | |
| Cc: | brettp | Difficulty: | easy |
Description (last modified by brettp)
set_attributes() sets all attributes to an empty string. ElggEntity::_ _isset() returns if property !== NULL.
Change History (5)
comment:1 Changed 3 years ago by brettp
- Description modified (diff)
comment:2 Changed 3 years ago by brettp
- Difficulty set to easy
comment:3 Changed 3 years ago by ewinslow
- Owner set to ewinslow
- Status changed from new to assigned
comment:4 Changed 3 years ago by ewinslow
- Resolution set to fixed
- Status changed from assigned to closed
(In [svn:7376]) Fixes #2490: attributes initialize to NULL instead of empty string or 0. Updated tests to reflect this
comment:5 Changed 2 years ago by brettp
(In [svn:7815]) Refs #2490. Using array_key_exists() instead of isset() in get() overrides to prevent a check for (invalid) metadata with the name of an attribute if that attribute evaluates to !isset().
Note: See
TracTickets for help on using
tickets.

Solution is to set attributes to NULL instead of empty string.