[wp-trac] [WordPress Trac] #43985: Privacy: The user request email should be sent in the user language

WordPress Trac noreply at wordpress.org
Tue Aug 7 19:49:23 UTC 2018


#43985: Privacy: The user request email should be sent in the user language
-------------------------------------+-------------------------------------
 Reporter:  Chouby                   |       Owner:  desrosj
     Type:  defect (bug)             |      Status:  accepted
 Priority:  normal                   |   Milestone:  4.9.9
Component:  I18N                     |     Version:  4.9.6
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  administration,
  has-unit-tests                     |  privacy
-------------------------------------+-------------------------------------

Comment (by desrosj):

 @swissspidy was kind enough to give me a review on this! He recommended
 using `restore_previous_locale()` instead of `restore_current_locale()`.
 The latter empties the history of locale switching and restores the
 original locale. If a plugin has performed additional locale switches
 before the locale is changed for the email, that history would be lost.
 `restore_previous_locale()` only undoes the most recent switch.

 The test class was also causing a widget test to fail. This was caused by
 the `set_current_screen()` calls. I added some screen related global
 variable `unset()`s to the `tearDown()` method, moved the `unset()` in the
 `setUp()` to `tearDown()` to ensure it is unset after the last test method
 runs, and consolidated some repeated code into the `tearDown()` method.

 He also asked for the user creation to be moved into
 `wpSetUpBeforeClass()`. The test class now only creates two users total.

 The passing build can be seen on my fork: https://travis-ci.org/desrosj
 /wordpress-develop/builds/413276594

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43985#comment:42>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list