[wp-trac] [WordPress Trac] #62349: Translations doing_it_wrong() fatal with wp_load_translations_early()

WordPress Trac noreply at wordpress.org
Tue Nov 5 22:47:25 UTC 2024


#62349: Translations doing_it_wrong() fatal with wp_load_translations_early()
-------------------------------------------+-------------------------
 Reporter:  kkmuffme                       |       Owner:  swissspidy
     Type:  defect (bug)                   |      Status:  assigned
 Priority:  normal                         |   Milestone:  6.7.1
Component:  I18N                           |     Version:  trunk
 Severity:  normal                         |  Resolution:
 Keywords:  reporter-feedback needs-patch  |     Focuses:
-------------------------------------------+-------------------------
Changes (by swissspidy):

 * keywords:   => reporter-feedback needs-patch
 * severity:  blocker => normal
 * milestone:  Awaiting Review => 6.7.1


Old description:

> Caused by changes in https://core.trac.wordpress.org/ticket/44937
>
> While testing 6.7 RC, I encountered an issue where this leads to a fatal
> error when `wp_load_translations_early()` is called early (e.g. in wpdb)
>
> If WP_DEBUG is enabled or any hook in the doing_it_wrong functions is
> hooked onto and loads translated text with __(), this will usually result
> in an infinite loop/fatal - essentially what was already discovered in
> query monitor: https://core.trac.wordpress.org/ticket/44937#comment:12
>
> However unlike that query monitor fix, this is inherent to
> `wp_load_translations_early()` it seems as well as to any hooks hooked on
> doing_it_wrong stuff
>
> Additionally, also it shouldn't trigger a doing it wrong for
> load_textdomain() when it's called via `wp_load_translations_early()`
> since that's a catch 22.
>
> I guess this should be fixed before WP 6.7 is released?

New description:

 Caused by changes in #44937

 While testing 6.7 RC, I encountered an issue where this leads to a fatal
 error when `wp_load_translations_early()` is called early (e.g. in wpdb)

 If `WP_DEBUG` is enabled or any hook in the `doing_it_wrong` functions is
 hooked onto and loads translated text with `__()`, this will usually
 result in an infinite loop/fatal - essentially what was already discovered
 in query monitor: https://core.trac.wordpress.org/ticket/44937#comment:12

 However unlike that query monitor fix, this is inherent to
 `wp_load_translations_early()` it seems as well as to any hooks hooked on
 doing_it_wrong stuff

 Additionally, also it shouldn't trigger a doing it wrong for
 load_textdomain() when it's called via `wp_load_translations_early()`
 since that's a catch 22.

 I guess this should be fixed before WP 6.7 is released?

--

Comment:

 People already get notified when being assigned. But there's usually no
 need for either. The people involved in the current release will triage
 tickets accordingly.

 Do you perhaps have more concrete steps to reproduce this? This way can
 truly assess the severit.

 ''Theoretically'' a call to `wp_load_translations_early()` and then
 `load_textdomain()` will populate the `$l10n` global already, so just-in-
 time translation loading wouldn't kick in.

 In any case, we should be able to add some end-to-end tests for
 `wp_load_translations_early()` thanks to the work from #61240

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


More information about the wp-trac mailing list