Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translations error when The Events Calendar Pro is activated #2814

Open
brianhogg opened this issue Nov 22, 2024 · 1 comment
Open

Translations error when The Events Calendar Pro is activated #2814

brianhogg opened this issue Nov 22, 2024 · 1 comment
Assignees

Comments

@brianhogg
Copy link
Contributor

brianhogg commented Nov 22, 2024

Reproduction Steps

  1. Activate The Events Calendar, The Events Calendar Pro, and LifterLMS
  2. Switch to another language, ie. Español
  3. Ensure translations are updated under Dashboard > Updates

Expected Behavior

No warnings, and translations for LifterLMS load correctly (ie. admin menu items)

Actual Behavior

Error that lifterlms translation done too soon

Error Messages / Logs

  • Include any relevant error messages or log files

#0 /Users/brianhogg/laravel/lifter2/wp-includes/class-wp-hook.php(326): {closure}('_load_textdomai...')
#1 /Users/brianhogg/laravel/lifter2/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#2 /Users/brianhogg/laravel/lifter2/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#3 /Users/brianhogg/laravel/lifter2/wp-includes/functions.php(6003): do_action('doing_it_wrong_...', '_load_textdomai...', 'Translation loa...', '6.7.0')
#4 /Users/brianhogg/laravel/lifter2/wp-includes/l10n.php(1370): _doing_it_wrong('_load_textdomai...', 'Translation loa...', '6.7.0')
#5 /Users/brianhogg/laravel/lifter2/wp-includes/l10n.php(1408): _load_textdomain_just_in_time('lifterlms')
#6 /Users/brianhogg/laravel/lifter2/wp-includes/l10n.php(194): get_translations_for_domain('lifterlms')
#7 /Users/brianhogg/laravel/lifter2/wp-includes/l10n.php(306): translate('Every %d Minute...', 'lifterlms')
#8 /Users/brianhogg/laravel/lifter2/wp-content/plugins/lifterlms/includes/class-llms-sessions.php(74): __('Every %d Minute...', 'lifterlms')
#9 /Users/brianhogg/laravel/lifter2/wp-includes/class-wp-hook.php(324): LLMS_Sessions->add_cron_schedule(Array)
#10 /Users/brianhogg/laravel/lifter2/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array)
#11 /Users/brianhogg/laravel/lifter2/wp-includes/cron.php(1116): apply_filters('cron_schedules', Array)
#12 /Users/brianhogg/laravel/lifter2/wp-includes/cron.php(247): wp_get_schedules()
#13 /Users/brianhogg/laravel/lifter2/wp-content/plugins/events-calendar-pro/src/Tribe/Recurrence/Queue_Processor.php(61): wp_schedule_event(1732281883, 'every_30mins', 'tribe_events_pr...')
#14 /Users/brianhogg/laravel/lifter2/wp-content/plugins/events-calendar-pro/src/Tribe/Recurrence/Queue_Processor.php(40): Tribe__Events__Pro__Recurrence__Queue_Processor->register_scheduled_task()
#15 /Users/brianhogg/laravel/lifter2/wp-content/plugins/events-calendar-pro/src/Tribe/Recurrence/Queue_Processor.php(31): Tribe__Events__Pro__Recurrence__Queue_Processor->manage_scheduled_task()
#16 /Users/brianhogg/laravel/lifter2/wp-content/plugins/events-calendar-pro/src/Tribe/Recurrence/Engines/Version_1.php(47): Tribe__Events__Pro__Recurrence__Queue_Processor->__construct()
#17 /Users/brianhogg/laravel/lifter2/wp-content/plugins/events-calendar-pro/src/Tribe/Service_Providers/RBE.php(39): Tribe__Events__Pro__Recurrence__Engines__Version_1->hook()
#18 /Users/brianhogg/laravel/lifter2/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/lucatume/di52/src/Container.php(462): Tribe__Events__Pro__Service_Providers__RBE->register()
#19 /Users/brianhogg/laravel/lifter2/wp-content/plugins/the-events-calendar/common/src/Common/Contracts/Container.php(46): TEC\Common\lucatume\DI52\Container->register('Tribe__Events__...')
#20 /Users/brianhogg/laravel/lifter2/wp-content/plugins/the-events-calendar/common/src/Tribe/Container.php(305): TEC\Common\Contracts\Container->register('Tribe__Events__...')
#21 /Users/brianhogg/laravel/lifter2/wp-content/plugins/events-calendar-pro/src/Tribe/Main.php(1825): tribe_register_provider('Tribe__Events__...')
#22 /Users/brianhogg/laravel/lifter2/wp-includes/class-wp-hook.php(324): Tribe__Events__Pro__Main->on_plugins_loaded('')
#23 /Users/brianhogg/laravel/lifter2/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#24 /Users/brianhogg/laravel/lifter2/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#25 /Users/brianhogg/laravel/lifter2/wp-settings.php(559): do_action('plugins_loaded')
#26 /Users/brianhogg/laravel/lifter2/wp-config.php(111): require_once('/Users/brianhog...')
#27 /Users/brianhogg/laravel/lifter2/wp-load.php(50): require_once('/Users/brianhog...')
#28 /Users/brianhogg/laravel/lifter2/wp-admin/admin.php(34): require_once('/Users/brianhog...')
#29 /Users/brianhogg/laravel/lifter2/wp-admin/options-general.php(10): require_once('/Users/brianhog...')
#30 /Users/brianhogg/.composer/vendor/laravel/valet/server.php(110): require('/Users/brianhog...')

System and Environment Information

System Report


HS-250084

@ideadude ideadude moved this to Awaiting Triage in Development Nov 22, 2024
@ideadude ideadude self-assigned this Nov 22, 2024
@brianhogg
Copy link
Contributor Author

If any plugin tries to schedule a task before the init action, this error will occur. The "fix" is to avoid making the "Every %d mins" string translatable via the cron_schedules filter https://github.com/gocodebox/lifterlms/blob/trunk/includes/class-llms-sessions.php#L74

I've commented on the core trac ticket about this scenario https://core.trac.wordpress.org/ticket/62462#comment:18 and reached out to the StellarWP team about moving the scheduling of the task to at least the init action.

@brianhogg brianhogg assigned brianhogg and unassigned ideadude Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Awaiting Triage
Development

No branches or pull requests

2 participants