Opened 12 years ago
Closed 10 years ago
#4891 closed defect (bug) (duplicate)
datebox xprofile value is returned false when using bp_member_profile_data()
Reported by: | imath | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | 1.2 |
Component: | Members | Keywords: | needs-testing |
Cc: |
Description
Hi,
I found this topic on BuddyPress.org forum. And i think it's actually a bug involving the xprofile_format_profile_field() function. When viewing a datebox xprofile into the xprofile loop it displays the right way, but when using bp_member_profile_data() within the members loop it returns false.
I suggest the diff attached to this ticket.
Attachments (1)
Change History (6)
#2
in reply to:
↑ 1
@
11 years ago
Replying to DJPaul:
How does a datebox field end up with a integer timestamp instead of a string for strtotime()?
Hi Paul, i thought as the filter xprofile_filter_format_field_value is using this condition, there might be a reason. Maybe the datebox field was stored as a timestamp in previous versions. As i had a doubt, i simply used the same condition than the filter.
Actually, in the function xprofile_format_profile_field(), if you simply replace line 373 by
$field_value = bp_format_time( strtotime( $field_value ), true, false );
it displays the value as expected.
Another approach is to use the filter bp_get_the_site_member_profile_data that seems to not being used by any function. In this case line 373 is becoming :
$field_value = apply_filters( 'bp_get_the_site_member_profile_data', $field_value, $field_type );
#3
@
11 years ago
- Keywords reporter-feedback removed
- Milestone changed from Awaiting Review to Future Release
- Version changed from 1.7 to 1.2
Going to punt this to future release so we have time to figure out how the problem occurred so we can get the right fix in. Thanks for creating this ticket from a forum post :)
http://vip.wordpress.com/documentation/code-and-theme-review-process/#plugin-guidelines
How does a datebox field end up with a integer timestamp instead of a string for strtotime()?