[wp-trac] [WordPress Trac] #10373: Proper number formatting related to i18n
WordPress Trac
noreply at wordpress.org
Mon Dec 14 01:15:13 UTC 2015
#10373: Proper number formatting related to i18n
---------------------------------+-----------------------------
Reporter: honza.skypala | Owner: SergeyBiryukov
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 4.5
Component: I18N | Version: 2.8.1
Severity: normal | Resolution:
Keywords: has-patch 4.5-early | Focuses:
---------------------------------+-----------------------------
Changes (by danielbachhuber):
* status: closed => reopened
* resolution: fixed =>
Comment:
Sorry @SergeyBiryukov :( WP-CLI [https://travis-ci.org/wp-cli/wp-
cli/jobs/96650203 found another issue] for you.
{{{
PHP Fatal error: Call to a member function suppress_errors() on null in
/tmp/wp-cli-test-run-566e1192a6b4b1.97422551/wp-includes/option.php on
line 102
PHP Stack trace:
PHP 1. {main}() /tmp/wp-cli-phar/wp:0
PHP 2. include() /tmp/wp-cli-phar/wp:4
PHP 3. include() phar:///tmp/wp-cli-phar/wp/php/boot-phar.php:5
PHP 4. WP_CLI\Runner->start() phar:///tmp/wp-cli-phar/wp/php/wp-
cli.php:21
PHP 5. WP_CLI\Runner->load_wordpress() phar:///tmp/wp-cli-
phar/wp/php/WP_CLI/Runner.php:697
PHP 6. require() phar:///tmp/wp-cli-
phar/wp/php/WP_CLI/Runner.php:739
PHP 7. require_wp_db() phar:///tmp/wp-cli-phar/wp/php/wp-settings-
cli.php:100
PHP 8. wpdb->__construct() /tmp/wp-cli-test-run-
566e1192a6b4b1.97422551/wp-includes/load.php:369
PHP 9. wpdb->db_connect() /tmp/wp-cli-test-run-
566e1192a6b4b1.97422551/wp-includes/wp-db.php:658
PHP 10. wpdb->select() /tmp/wp-cli-test-run-566e1192a6b4b1.97422551
/wp-includes/wp-db.php:1560
PHP 11. wp_load_translations_early() /tmp/wp-cli-test-run-
566e1192a6b4b1.97422551/wp-includes/wp-db.php:1054
PHP 12. WP_Locale->__construct() /tmp/wp-cli-test-run-
566e1192a6b4b1.97422551/wp-includes/load.php:863
PHP 13. WP_Locale->init() /tmp/wp-cli-test-run-
566e1192a6b4b1.97422551/wp-includes/locale.php:360
PHP 14. get_option() /tmp/wp-cli-test-run-566e1192a6b4b1.97422551/wp-
includes/locale.php:194
}}}
In short, it's not safe to use `get_option()` inside of
`WP_Locale::init()` because `WPDB` calls `wp_load_translations_early()`
when it can't connect to the database.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/10373#comment:33>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list