TycheSoftwares / custom-order-numbers-for-woocommerce

This repository is for the Custom Order Numbers for WooCommerce- Lite
2 stars 2 forks source link

An error occurs when changing the site language in WordPress version 6.7. #134

Closed mokshasharmila13 closed 4 hours ago

mokshasharmila13 commented 1 week ago

Prerequisites

Describe the bug

An error occurs when changing the site language in WordPress.

Steps to reproduce

  1. Install WordPress 6.7 & WooCommerce 9.4.1.
  2. Change the WordPress site language to some other language.
  3. You will see the error in the debug log and the query monitor.

Error - Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the custom-order-numbers-for-woocommerce 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.)

PHP Warning: Invalid argument supplied for foreach() in /home/kacamezazo5745/web/frac.instawp.xyz/public_html/wp-content/plugins/custom-order-numbers-for-woocommerce/includes/class-alg-wc-custom-order-numbers-core.php on line 270

image

Expected behavior

There should be no warnings/errors displayed from our plugin.

WordPress Environment

No

Isolating the problem

Additional field

No response

mokshasharmila13 commented 8 hours ago

When using the Loco Translate plugin for translation with the 'system' location, the error still appears. There should be no errors for the location selected using the Loco Translate plugin.

image