Skip to content

Conversation

@agibson-godaddy
Copy link
Contributor

@agibson-godaddy agibson-godaddy commented Apr 29, 2025

Summary

Release: #755

This is a partial fix (not guaranteed to be 100% complete) to address errors like this:

Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the woocommerce-memberships 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. (This message was added in version 6.7.0.)

Release: #755

Details

  • SV_WC_Hook_Deprecator has been updated to accept the entire plugin instance as a parameter instead of just the plugin name. That way we can call get_plugin_name() when actually used instead of inside the constructor.

QA

Before merge

  • I have confirmed these changes in each supported minor WooCommerce version

@agibson-godaddy agibson-godaddy self-assigned this Apr 29, 2025
@agibson-godaddy agibson-godaddy changed the title [WIP] Fixes for loading translations too early Fixes for loading translations too early Apr 29, 2025
@agibson-godaddy agibson-godaddy marked this pull request as ready for review April 29, 2025 12:14
@ajaynes-godaddy
Copy link
Contributor

With this branch and the dev branch of the Framework, I'm still seeing the _doing_it_wrong() notices for memberships at least on the WooCommerce > Settings > Memberships page. Trying to track down what's triggering it.

@ajaynes-godaddy
Copy link
Contributor

Sorry, meant to leave that last comment on the memberships PR.

@ajaynes-godaddy ajaynes-godaddy mentioned this pull request Apr 29, 2025
1 task
Copy link
Contributor

@ajaynes-godaddy ajaynes-godaddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ajaynes-godaddy ajaynes-godaddy merged commit 7fd8e73 into release/5.15.7 Apr 29, 2025
5 checks passed
@ajaynes-godaddy ajaynes-godaddy deleted the fix/early-translations branch April 29, 2025 20:09
ajaynes-godaddy added a commit that referenced this pull request Apr 30, 2025
* Version 5.15.7

* Update versions in coffee files

* Fixes for loading translations too early (#757)

* Pass entire plugin instance into the deprecator class

* Improve the 5.15.7 changelog entry in the SV_WC_Hook_Deprecator constructor.

* Changelog language tweaks.

* Add a changelog entry for the behavior change in the plugin-overridable SV_WC_Plugin::init_hook_deprecator() method.

* Docblock for getPluginName().

---------

Co-authored-by: Andrew Jaynes <[email protected]>

* Update a use of @import to @use for future compat with Dart Sass 3.0.

* Pot file updates from npm run build.

* Add a changelog entry for the the translations fixes.

* s/logging/triggering

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ashley Gibson <[email protected]>
Co-authored-by: Ashley Gibson <[email protected]>
Co-authored-by: Andrew Jaynes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants