[buddypress-trac] [BuddyPress] #2172: Function bp_profile_field_data () returns raw data for non-string data types
buddypress-trac at lists.automattic.com
buddypress-trac at lists.automattic.com
Thu Mar 11 04:04:32 UTC 2010
#2172: Function bp_profile_field_data () returns raw data for non-string data
types
-------------------------------------------------------------------+--------
Reporter: foxly | Owner:
Type: defect | Status: new
Priority: minor | Milestone: 1.2.3
Keywords: bp_profile_field_data (), bp_get_profile_field_data () |
-------------------------------------------------------------------+--------
The function bp_profile_field_data () is used to retrieve data from the
current buddypress user’s extended profile.
When the function is called on string data fields, it returns the value
the user entered.
However when the function is called on ‘date’ type data it appears to
return it in milliseconds 1/1/1970 format; and when the function is called
on a “checkbox” field, it returns the data as some sort of internal data
structure; for example, a checkbox group “Customers”, “Friends”, and
“Networking” would be returned as:
a:3:{i:0;s:9:"Customers";i:1;s:7:"Friends";i:2;s:10:"Networking";}
To replicate this problem:
1) On a default buddypress installation using the default template, create
several extended profile fields using checkbox and date data types.
2) Log in as a test user and fill-out the profile fields you created.
3) At line 7 in members/single/profile/profile-loop.php, add the following
code:
<?php bp_profile_field_data ('field=XXX') ?>
<?php bp_profile_field_data ('field=YYY') ?>
<?php bp_profile_field_data ('field=ZZZ') ?>
(where ‘XXX’, ‘YYY’, and ‘ZZZ’ are names of valid fields in the BP
extended profile, which are date or checkbox data types)
Then visit the user’s “profile” page.
The raw field data will be dumped into the user’s profile listing.
While both of the above data formats are easily converted to human-
readable forms, is this the intended output of the function, or is it
defective?
IMPORTANT: There is no documentation for this function in the buddypress
source code or on the buddypress website. (Forum posts are not an
acceptable form of documentation as they often contain outdated or
incorrect information.)
Please consider releasing properly documented source code.
--
Ticket URL: <http://trac.buddypress.org/ticket/2172>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list