Make WordPress Core

Opened 5 weeks ago

Closed 4 weeks ago

Last modified 4 weeks ago

#62349 closed defect (bug) (wontfix)

Translations doing_it_wrong() fatal with wp_load_translations_early()

Reported by: kkmuffme's profile kkmuffme Owned by: swissspidy's profile swissspidy
Milestone: Priority: normal
Severity: normal Version: 6.7
Component: I18N Keywords: needs-patch
Focuses: Cc:

Description (last modified by swissspidy)

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?

Change History (5)

#1 @kkmuffme
5 weeks ago

OT: just to be sure: when I assign somebody to a ticket, do you get notified or do I also @ the person? e.g. @swissspidy

#2 @swissspidy
5 weeks ago

  • Description modified (diff)
  • Keywords reporter-feedback needs-patch added
  • Milestone changed from Awaiting Review to 6.7.1
  • Severity changed from blocker to normal

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

#3 @swissspidy
5 weeks ago

  • Milestone changed from 6.7.1 to Future Release

At first glance I don't run into any fatals or infinite loops when triggering wp_load_translations_early().

And when someone is hooking into doing_it_wrong like Query Monitor did, then it's up to them to unhook themselves to prevent infinite loops.

So yeah, without any clear steps to reproduce I actually don't see an issue here.

#4 @kkmuffme
4 weeks ago

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

And when someone is hooking into doing_it_wrong like Query Monitor did, then it's up to them to unhook themselves to prevent infinite loops.

That was my issue essentially

#5 @desrosj
4 weeks ago

  • Keywords reporter-feedback removed
  • Milestone Future Release deleted
Note: See TracTickets for help on using tickets.