• Resolved peter8nss

    (@peter8nss)


    Since upgrading to WordPress 6.7 I’m getting the following error on my development system where I have debug enabled:

    Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the the-events-calendar domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/wp-includes/functions.php on line 6114

    I think this is related to the internalization improvements in WordPress 6.7 and specifically the check on “translations are loaded too early”: https://make.wordpress.org/core/2024/10/21/i18n-improvements-6-7/

    I’ve tracked this down to a couple of places in the code:

    • calling esc_html__ in Global_Elements::setup_arguments and setup_content_headings
    • calling __ in Tribe__Events__Aggregator__CLI__Service_Provider::register

    There may well be others that I’ve not reached.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Darian

    (@d0153)

    Hi @peter8nss

    I’m glad you brought this to our attention, I can see how this issue impacts your translations. I’ve created an internal ticket [TECTRIA-545] to address this issue and I’ve included your specific use case in it to communicate it to our team.

    We prioritize bugs by taking into consideration the number of users impacted as well as how the bug impacts one’s ability to run an event/sell tickets. I don’t have a specific timeline as to when this issue will be resolved, but trust that our team is aware. Our team communicates updates and bug fixes in our newsletter and via our changelog.

    In the meantime, the current workaround that is available is to downgrade your WP to 6.6.2.

    I’m happy to help if any other questions are coming up around this topic, otherwise I’ll go ahead and close this ticket.

    Thanks again for reporting this issue and for using The Events Calendar! Have a great day.

    Internal Bug Ticket Reference: TECTRIA-545

    Plugin Author Gustavo Bordoni

    (@bordoni)

    Hi @peter8nss,

    We fixed a couple of reports of this problem in the next upcoming version, including the ones you mentioned.

    Thank you for reporting,

    Thread Starter peter8nss

    (@peter8nss)

    Installed version 6.8.2, now seeing this error when displaying installed plugins either from dashboard or WP CLI. The traceback is:

    _load_textdomain_just_in_time; Trace: require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('plugins_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, Tribe__Main->plugins_loaded, do_action('tribe_common_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, Tribe__Events__Main->bootstrap, Tribe__Events__Main->bind_implementations, tribe_register_provider, TEC\\Common\\Contracts\\Container->register, TEC\\Common\\lucatume\\DI52\\Container->register, Tribe\\Events\\Views\\V2\\Service_Provider->register, TEC\\Common\\Contracts\\Container->register, TEC\\Common\\lucatume\\DI52\\Container->register, Tribe\\Events\\Views\\V2\\iCalendar\\iCalendar_Handler->register, tribe, TEC\\Common\\lucatume\\DI52\\Container->make, TEC\\Common\\Contracts\\Container->get, TEC\\Common\\lucatume\\DI52\\Container->get, TEC\\Common\\lucatume\\DI52\\Builders\\Resolver->resolve, TEC\\Common\\lucatume\\DI52\\Builders\\Resolver->resolveBound, TEC\\Common\\lucatume\\DI52\\Builders\\ClassBuilder->build, Tribe\\Events\\Views\\V2\\iCalendar\\Links\\Link_Abstract->__construct, Tribe\\Events\\Views\\V2\\iCalendar\\Links\\Google_Calendar->register, __, translate, get_translations_for_domain, _load_textdomain_just_in_time, _doing_it_wrong

    Which suggests another source of the problem is calling __ in Tribe\\Events\\Views\\V2\\iCalendar\\Links\\Google_Calendar->register.

    ps: Would you prefer this to have been raised as a separate item?

    • This reply was modified 1 month, 3 weeks ago by peter8nss.
    Thread Starter peter8nss

    (@peter8nss)

    And there are similar issues in:

    Tribe\Events\Views\V2\iCalendar\Links\iCal->register
    Tribe\Events\Views\V2\iCalendar\Links\Outlook_365->register
    Tribe\Events\Views\V2\iCalendar\Links\Outlook_Live->register
    Tribe\Events\Views\V2\iCalendar\Links\iCalendar_Export->register
    Tribe\Events\Views\V2\iCalendar\Links\Outlook_Export->register

    If you clear those, I think the next one will be Tribe__Events__Aggregator__Service->register_messages calling esc_html__. Unfortunately, it look like only the first case gets reported so until that is fixed you don’t see the next one.

    I’m still getting the same sort of error message even after updating to 6.8.2. I don’t know how to try to trace it back to what code is causing it. If anyone has any ideas how I might do that I am open to suggestions.

    (“Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the the-events-calendar domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in C:\Users\Daniel\Source\Repos\wordpress-project\wp-includes\functions.php on line 6114“)

    Thread Starter peter8nss

    (@peter8nss)

    Re “I don’t know how to try to trace it back to what code is causing it”:

    Use the doing_it_wrong_run hook to call a function that uses wp_debug_backtrace_summary to get the callling stack and then log that somewhere for you to look at.

    Plugin Author Gustavo Bordoni

    (@bordoni)

    We released a version today that should fix at least the two problems you’ve reported @peter8nss.

    If you are unsure, you can always install the plugin Query Monitor, and look at the Logs at the top bar, it will normally include more details that you can relay here to us.

    Thread Starter peter8nss

    (@peter8nss)

    Looks like 6.8.2.1 fixes the calendar register cases.

    Next ones are in Tribe__Events__Aggregator__Errors->__construct where __ is used when calling tribe_register_error.

    require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('plugins_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, Tribe__Main->plugins_loaded, do_action('tribe_common_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, Tribe__Events__Main->bootstrap, Tribe__Events__Main->addHooks, tribe, TEC\Common\lucatume\DI52\Container->make, TEC\Common\Contracts\Container->get, TEC\Common\lucatume\DI52\Container->get, TEC\Common\lucatume\DI52\Builders\Resolver->resolve, TEC\Common\lucatume\DI52\Builders\Resolver->resolveBound, TEC\Common\lucatume\DI52\Builders\ClassBuilder->build, Tribe__Events__Aggregator->load, Tribe__Events__Aggregator__Errors::instance, Tribe__Events__Aggregator__Errors->__construct, __, translate, get_translations_for_domain, _load_textdomain_just_in_time, _doing_it_wrong

    And after that Tribe__Events__Aggregator__API__Origins->__construct:

    require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('plugins_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, Tribe__Main->plugins_loaded, do_action('tribe_common_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, Tribe__Events__Main->bootstrap, Tribe__Events__Main->addHooks, tribe, TEC\Common\lucatume\DI52\Container->make, TEC\Common\Contracts\Container->get, TEC\Common\lucatume\DI52\Container->get, TEC\Common\lucatume\DI52\Builders\Resolver->resolve, TEC\Common\lucatume\DI52\Builders\Resolver->resolveBound, TEC\Common\lucatume\DI52\Builders\ClassBuilder->build, Tribe__Events__Aggregator->load, Tribe__Events__Aggregator->api, Tribe__Events__Aggregator__API__Origins->__construct, __, translate, get_translations_for_domain, _load_textdomain_just_in_time, _doing_it_wrong

    Initial reaction is that might be the last of them.

    Plugin Author Gustavo Bordoni

    (@bordoni)

    Thank you, this one might take a little longer for us to fix, due to BlackFriday being so close. But we will get it out as soon as possible.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.