WordPress.org

Make WordPress Core

Opened 8 months ago

Last modified 4 months ago

#44084 assigned defect (bug)

Privacy: The personal data export file should be generated in the user's locale

Reported by: coreymckrill Owned by: desrosj
Milestone: Future Release Priority: normal
Severity: normal Version: 4.9.6
Component: Privacy Keywords: has-patch needs-testing needs-unit-tests needs-refresh
Focuses: Cc:

Description

Similar to #43985, the HTML file containing the personal data export should be translated into the locale the user has selected for their profile, with a fallback to the site's locale.

Attachments (2)

file.diff (715 bytes) - added by vanyukov 6 months ago.
44084.diff (798 bytes) - added by desrosj 5 months ago.

Download all attachments as: .zip

Change History (27)

#1 @iandunn
8 months ago

  • Component changed from General to Administration
  • Milestone changed from Awaiting Review to 4.9.7
  • Status changed from new to assigned
  • Version set to trunk

#2 @iandunn
8 months ago

It'd be nice to get this in 4.9.6, but at this point it doesn't seem like there's enough time. cc @desrosj just in case you think it should be there.

#3 @desrosj
8 months ago

@iandunn I agree. Would be great, but I don't think there is enough time to test this properly. If a committer feels strongly about this for 4.9.6, they are more than welcome to see it through.

#4 @desrosj
8 months ago

  • Component changed from Administration to Privacy

Moving to the new Privacy component.

#5 @desrosj
8 months ago

  • Version changed from trunk to 4.9.6

Marking privacy bugs as introduced in 4.9.6.

#6 @desrosj
8 months ago

  • Milestone changed from 4.9.7 to 4.9.8

Moving all tickets in 4.9.7 to 4.9.8.

#7 @sebakurzyn
7 months ago

  • Resolution set to worksforme
  • Status changed from assigned to closed

I already tested this bug and everything works correctly. Tested on Duch translation, single site. Email and export data have the correct language.

#8 @pento
6 months ago

  • Milestone 4.9.8 deleted

#9 @SergeyBiryukov
6 months ago

  • Milestone set to 4.9.8
  • Resolution worksforme deleted
  • Status changed from closed to reopened

Tested with the following configuration:

  • Site's default locale: English (en_US)
  • Administrator's locale: Russian (ru_RU)
  • Editor's locale: Spanish (es_ES)

When exporting Editor's personal data, both the confirmation email and the export file use the administrator's locale (Russian in my case). Per comment:9:ticket:43985, they should use the requester's locale instead (Spanish in my case), with a fallback to the site's default locale for visitors who don't have an account.

Last edited 6 months ago by SergeyBiryukov (previous) (diff)

@vanyukov
6 months ago

#10 @vanyukov
6 months ago

  • Keywords has-patch added; needs-patch removed

Added a patch. Will update the locale if the email for data export is from a valid user

#11 @desrosj
6 months ago

  • Keywords needs-testing added; gdpr removed
  • Milestone changed from 4.9.8 to 4.9.9

#12 @desrosj
6 months ago

  • Keywords needs-unit-tests added

This ticket was mentioned in Slack in #core-privacy by desrosj. View the logs.


6 months ago

This ticket was mentioned in Slack in #core-privacy by desrosj. View the logs.


6 months ago

@desrosj
5 months ago

#15 @desrosj
5 months ago

44084.diff is a different approach than file.diff.

It utilizes the user ID stored in the WP_User_Request object to prevent an unnecessary database query in get_user_by(). It also switches to the site's default locale if the current user is using a different locale, and switches back after the file is done generating.

There are a few strings not included in the actual file that are still not translated:

  • the stripped email, which has @ replaced with -at-.
  • the file basename, which is wp-personal-data-file-$stripped_email.

These two strings should probably be translated as well. But proper sanitization will need to be added for filenames with non-English characters.

Another situation to consider. An administrator can click a link to download the data export file in the admin. When that is clicked, a fresh file is generated. With 44084.diff, the file will always be in the user's selected locale. Should the file ever be generated in the administrator's locale instead?

Tests for this change should be added to the test class being worked on in #44233. I can add those once that is committed.

Last edited 5 months ago by desrosj (previous) (diff)

This ticket was mentioned in Slack in #core-privacy by desrosj. View the logs.


5 months ago

This ticket was mentioned in Slack in #core-privacy by desrosj. View the logs.


5 months ago

#18 @idea15
5 months ago

  • Owner set to javorszky
  • Status changed from reopened to assigned

This ticket was mentioned in Slack in #core-privacy by desrosj. View the logs.


4 months ago

This ticket was mentioned in Slack in #core by desrosj. View the logs.


4 months ago

#21 @desrosj
4 months ago

  • Keywords needs-refresh added
  • Owner changed from javorszky to desrosj

After discussion in yesterday's #core-privacy chat, it was determined that the data should be exported as follows:

  • If the user's locale matches the site's default locale, only one export file in that locale will be generated.
  • If the user's locale does not match the site's default locale, two files will be added to the ZIP file (one in each locale).
  • If the administrator's locale does not match either of these, no additional action will be performed.

This ticket was mentioned in Slack in #core-privacy by desrosj. View the logs.


4 months ago

This ticket was mentioned in Slack in #core-privacy by desrosj. View the logs.


4 months ago

#24 @pento
4 months ago

  • Milestone changed from 4.9.9 to Future Release

This ticket was mentioned in Slack in #core-privacy by webdevlaw. View the logs.


4 months ago

Note: See TracTickets for help on using tickets.