Opened 10 years ago
Closed 10 years ago
#6354 closed defect (bug) (fixed)
`xprofile_insert_field()` `empty()` checks break booleans when updating existing field
Reported by: | boonebgorges | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 2.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Extended Profile | Keywords: | |
Cc: |
Description
If you pass a 'field_id' to xprofile_insert_field()
to update an existing field, it's not possible to set any true
field to false
. This is because all of the checks look like:
if ( ! empty( $r['foo'] ) ) { $this->foo = $r['foo']; }
and false
will not pass the test.
Change History (2)
Note: See
TracTickets for help on using
tickets.
The same applies to any field that could optionally be set to a falsey value - as when you're setting 'field_order' to 0.