#7300 closed defect (bug) (fixed)
xprofile date field year regression on existing fields
Reported by: | DJPaul | Owned by: | djpaul |
---|---|---|---|
Milestone: | 2.7.1 | Priority: | high |
Severity: | major | Version: | |
Component: | Extended Profile | Keywords: | commit |
Cc: |
Description
If you had a date field prior to 2.7 upgrade, the year dropdown box had many values. Post-upgrade, only 2016 is showing (probably related to the current year). You have to go in and edit and resave that field with a date range.
Reported in https://buddypress.org/support/topic/problems-with-xprofile-field-visibilty-on-2-7-0/
Attachments (2)
Change History (10)
#3
@
8 years ago
Because existing fields do not have the new meta properties set, the requested field values were being returned from meta as a empty string, not a boolean false, and the type strictness of this check caused the value to be set to that empty string, not from the defaults array.
This contradicts our PHPDoc block for bp_xprofile_get_meta
which says it returns a boolean false if the request value is not set... which is how WP's https://codex.wordpress.org/Function_Reference/get_user_meta works, so we probably need to go through all our custom meta functions, fix the docblocks, and check other instances we might be handling type strict. This second part itself should be its own ticket, but I want confirmation that I've looked at this correctly first. :)
#5
@
8 years ago
- Keywords commit added
- Owner set to djpaul
- Status changed from new to assigned
Thanks for tracking this down, @DJPaul. Fix looks good to me.
This contradicts our PHPDoc block for bp_xprofile_get_meta which says it returns a boolean false if the request value is not set... which is how WP's https://codex.wordpress.org/Function_Reference/get_user_meta works, so we probably need to go through all our custom meta functions, fix the docblocks, and check other instances we might be handling type strict. This second part itself should be its own ticket, but I want confirmation that I've looked at this correctly first. :)
Ugh. I feel like I specifically looked at this when migrating the meta functions to WP's. I wonder if xprofile is a special case, because it translates object_id. In any case, definitely worth a separate ticket.
The CSS looks wrong for the Range field, too, per Screen Shot 2016-10-23 at 10.13.43.png.