Make WordPress Core

Ticket #44644: 44644.diff

File 44644.diff, 1.5 KB (added by garrett-eclipse, 6 years ago)

Patch to address the issue of admin downloads triggering the request-completed.

  • src/wp-admin/includes/file.php

     
    25262526                if ( is_wp_error( $mail_success ) ) {
    25272527                        wp_send_json_error( $mail_success->get_error_message() );
    25282528                }
     2529
     2530                // Update the request to completed state when the export email is sent.
     2531                _wp_privacy_completed_request( $request_id );
    25292532        } else {
    25302533                // Modify the response to include the URL of the export file so the browser can fetch it.
    25312534                $export_file_url = get_post_meta( $request_id, '_export_file_url', true );
     
    25342537                }
    25352538        }
    25362539
    2537         // Update the request to completed state.
    2538         _wp_privacy_completed_request( $request_id );
    2539 
    25402540        return $response;
    25412541}
  • tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php

     
    624624                                true,
    625625                                'last',
    626626                        ),
     627                        // Leave the request as pending for the last exporter on the last page, without email.
     628                        // This check was updated to account for admin vs user export; we don't want to mark the request as completed without the email as that indicate it's an admin download.
    627629                        array(
    628                                 'request-completed',
     630                                'request-pending',
    629631                                'last',
    630632                                'last',
    631633                                'last',