Skip to:

Opened 11 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's profile imath Owned by:
Milestone: Priority: normal
Severity: minor Version: 1.2
Component: Members Keywords: needs-testing



I found this topic on 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)

4891.diff (753 bytes) - added by imath 11 years ago.

Download all attachments as: .zip

Change History (6)

11 years ago

#1 follow-up: @DJPaul
11 years ago

  • Keywords reporter-feedback added

How does a datebox field end up with a integer timestamp instead of a string for strtotime()?

#2 in reply to: ↑ 1 @imath
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 @DJPaul
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 :)

#4 @DJPaul
11 years ago

  • Keywords needs-testing added; has-patch removed

#5 @imath
10 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Closing as it's a duplicate of #4365 on which i've just suggested 2 patches to try to solve this issue.

Note: See TracTickets for help on using tickets.