[buddypress-trac] [BuddyPress Trac] #6789: XProfile: do not store serialized arrays for multi-value profile field data

buddypress-trac noreply at wordpress.org
Wed Jun 21 15:52:53 UTC 2017


#6789: XProfile: do not store serialized arrays for multi-value profile field data
------------------------------+-----------------------------
 Reporter:  Offereins         |       Owner:
     Type:  enhancement       |      Status:  new
 Priority:  normal            |   Milestone:  Future Release
Component:  Extended Profile  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:                    |
------------------------------+-----------------------------

Comment (by Offereins):

 Reiterating on this, the latest uploaded patch (.05) contains the
 following fixes to .03:

 === In `BP_XProfile_ProfileData` ===

 Empty lists for multiple-values are stored as a serialized empty array.
 This is to signal that the field is deliberately empty, ignoring the need
 to suggest defaults in the editing interface. The current patch suggests
 to continue to do so. The logic is implemented for the following methods
 comparing `array() === maybe_unserialize( $value )`:

 * `populate()`
 * `save()`
 * `get_data_for_user()`
 * `get_value_by_id()`
 * `get_value_byfieldname()`
 * `get_random()`

 === In xprofile functions ===

 * `xprofile_sanitize_data_value_before_save()` - don't bail the filtering
 when the field value is actually valid: 0 in case of a number field. See
 similar checks in `xprofile_set_field_data()`.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6789#comment:16>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list