#47265 closed defect (bug) (fixed)
Uncaught Error: Call to undefined function load_default_textdomain() in /wp-includes/class-wp-fatal-error-handler.php:41
Reported by: | daxelrod | Owned by: | desrosj |
---|---|---|---|
Milestone: | 5.2.1 | Priority: | normal |
Severity: | normal | Version: | 5.2 |
Component: | Site Health | Keywords: | has-patch servehappy fixed-major |
Focuses: | Cc: |
Description (last modified by )
Noticed this error after updating to WP 5.2 on PHP 7.3. This error may be related to errors thrown in caching plugins, or other drop-ins which execute and error early.
My error was thrown after a fatal error in WP Redis:
Uncaught RedisException: Connection timed out
I Googled to see if anything had been written on this issue and found a completely separate live website presenting the same error (I am not associated with this website): http://masacoat-asahi.com/
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/sites/heteml/users/h/u/b/hubstyle/web/masacoat-asahi.com/wp-content/advanced-cache.php:106 Stack trace: #0 /home/sites/heteml/users/h/u/b/hubstyle/web/masacoat-asahi.com/wp-content/advanced-cache.php(184): SiteManagerAdvancedCache->__construct() #1 /home/sites/heteml/users/h/u/b/hubstyle/web/masacoat-asahi.com/wp-settings.php(95): include('/home/sites/het...') #2 /home/sites/heteml/users/h/u/b/hubstyle/web/masacoat-asahi.com/wp-config.php(85): require_once('/home/sites/het...') #3 /home/sites/heteml/users/h/u/b/hubstyle/web/masacoat-asahi.com/wp-load.php(37): require_once('/home/sites/het...') #4 /home/sites/heteml/users/h/u/b/hubstyle/web/masacoat-asahi.com/wp-blog-header.php(13): require_once('/home/sites/het...') #5 /home/sites/heteml/users/h/u/b/hubstyle/web/masacoat-asahi.com/index.php(17): require('/home/sites/het...') #6 {main} thrown in /home/sites/heteml/users/h/u/b/hubstyle/web/masacoat-asahi.com/wp-content/advanced-cache.php on line 106 Fatal error: Uncaught Error: Call to undefined function load_default_textdomain() in /home/sites/heteml/users/h/u/b/hubstyle/web/masacoat-asahi.com/wp-includes/class-wp-fatal-error-handler.php:41 Stack trace: #0 [internal function]: WP_Fatal_Error_Handler->handle() #1 {main} thrown in /home/sites/heteml/users/h/u/b/hubstyle/web/masacoat-asahi.com/wp-includes/class-wp-fatal-error-handler.php on line 41
It appears this code was introduced in #47093 (changeset 45277) to fix an issue with recovery mode emails locale.
Suggest a conditional for if locale is not defined yet.
Attachments (1)
Change History (10)
This ticket was mentioned in Slack in #core-php by joyously. View the logs.
5 years ago
#2
@
5 years ago
- Keywords has-patch servehappy dev-feedback added
- Milestone changed from Awaiting Review to 5.2.1
- Version set to 5.2
#4
@
5 years ago
- Keywords commit added; dev-feedback removed
This is pretty edge case. It is a bug in a drop-in, which again is something we don't support handling. However, this patch is pretty simple, so we should go ahead.
I added a patch that checks for
load_default_textdomain
and bails translating if it isn't available. AFAICT it is too early to try and usewp_load_translations_early
to get access toload_default_textdomain
since the option APIs aren't available.When testing, I also noticed that if a fatal error occurs in
advanced-cache.php
,WP_Error
isn't loaded so I added a check to load it when it isn't available.I tentatively milestoned this for 5.2.1, I think it is a simple enough fix to include.