[wp-trac] [WordPress Trac] #44215: Personal data exports - Empty values are included in the report

WordPress Trac noreply at wordpress.org
Thu May 24 14:37:40 UTC 2018


#44215: Personal data exports - Empty values are included in the report
-------------------------+-------------------------------------------------
 Reporter:  bor0         |      Owner:  (none)
     Type:  defect       |     Status:  new
  (bug)                  |
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Privacy      |    Version:  trunk
 Severity:  normal       |   Keywords:  has-patch dev-feedback has-
  Focuses:               |  screenshots
-------------------------+-------------------------------------------------
 Empty values should not be included in the report. Otherwise, the report
 will be cluttered with empty values.

 Use the following code in `mu-plugins` to reproduce:

 {{{
 <?php
 function exporter_1( $email_address, $page = 1 ) {
         return array(
                 'data' => array( array(
                         'group_id'    => 'group-1',
                         'group_label' => __( 'Orders', 'woocommerce-
 services' ),
                         'item_id'     => 'item-1',
                         'data'  => array(
                                 array(
                                         'name'  => __( 'Exporter 1' ),
                                         'value' => 1234,
                                 ),
                                 array(
                                         'name'  => __( 'Exporter 2' ),
                                         'value' => '',
                                 ),
                                 array(
                                         'name'  => __( 'Exporter 3' ),
                                         'value' => '0',
                                 ),
                                 array(
                                         'name'  => __( 'Exporter 4' ),
                                         'value' => 0,
                                 ),
                         ),
                 ) ),
                 'done' => true,
         );
 }

 function register_exporter_1( $exporters ) {
         $exporters['exporter_1'] = array(
                 'exporter_friendly_name' => __( 'Exporter 1' ),
                 'callback' => 'exporter_1',
         );
         return $exporters;
 }

 add_filter(
         'wp_privacy_personal_data_exporters',
         'register_exporter_1'
 );
 }}}

 Results:

 Before proposed patch:
 [[Image(https://cloudup.com/iPJ8ocUnyiz)]]

 After proposed patch:
 [[Image(https://cloudup.com/i7MqWkMZjrj)]]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44215>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list