This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 7 replies, has 2 voices.

Last updated by chrisC-23 3 weeks, 4 days ago.

Assigned support staff: Raja Mohammed.

Author Posts
September 13, 2019 at 6:22 pm #4570373

chrisC-23

This is a local test site.
Each time I make a change to my theme I receive these two warnings:
( ! ) Warning: Cannot modify header information - headers already sent by (output started at C:\wamp64\www\Durotire\wp-content\plugins\sitepress-multilingual-cms\classes\class-wpml-mo-file-search.php:128) in C:\wamp64\www\Durotire\wp-admin\includes\misc.php on line 1196

( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp64\www\Durotire\wp-content\plugins\sitepress-multilingual-cms\classes\class-wpml-mo-file-search.php on line 128

September 16, 2019 at 5:51 am #4576395

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello there,

I will help you with the issue.

The warning message displayed can be due to various reasons, Make sure the theme does not output anything before the PHP execution happen. A detailed technical explanation about the issue and how to resolve can be viewed at https://stackoverflow.com/a/8028987

However, A entire stack trace of the error will give more information and easy to identify which part of the code actually caused the error. if you can provide the entire stack trace that would be helpful.

https://stackoverflow.com/questions/1159216/how-can-i-get-php-to-produce-a-backtrace-upon-errors

Kind regards
Raja

September 16, 2019 at 3:41 pm #4582113

chrisC-23

Thank you for the response, Raja. And I apologize for not offering additional details. I should point out that this occurs using the stock Twenty Nineteen and Storefront themes with no modifications. Since Twenty Nineteen is a stock theme from WP, I assume it is not doing anything strange like outputting processes before the PHP.
Before going thru the process of add behind the scenes PHP scripts, would providing the call stack information that outputs with the errors help? If so, I have attached two images showing those details.

September 17, 2019 at 4:56 am #4585593

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thanks for the detailed information,

The error notice is from the location of code where WPML tries to access and scan the mo files from the language folders of theme, Either the language folder is not available or the permission is restricted. Please verify whether your theme has languages folder and permission to that folder it correctly set as the WordPress requirement

https://wordpress.org/support/article/changing-file-permissions/

September 17, 2019 at 2:49 pm #4589331

chrisC-23

Raja,
I am using the basic themes and have never set up MO files for either.
Looking at my settings, would any of these lead to this conflict?
* WPML Admin>Languages
- "Make themes work multilingual" - this is checked
- SEO Options: display alternative languages in HEAD section is checked with position of hreflang selected as "as early as possible"
* WMPL Admin>Theme and plugins localization
- "Don't use String translation to translate themes and plugins" is selected
--the option to automatically load the theme's .mo file is not selected
WPML Admin>Taxanomy
* nothing selected to Translate
I have not activated WMPL Translation Management or WPML String Translation plugins

Would any of these lead to the errors?

September 18, 2019 at 5:00 am #4592479

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thanks for the detailed information.

Please activate WPML Translation management and WPML string translation, That should solve the issue since the mo scan is related to the string translations. If the issue still persists, Please provide a snapshot copy of your site.

You can use the Duplicator plugin to create a snapshot of the site and share the package link with me http://wordpress.org/plugins/duplicator/

I have enabled private fields for you to securely share the details.

Kind regards
Raja

September 18, 2019 at 4:22 pm #4598951

chrisC-23

Activating the String Translation was the trick.
Strange that this would be needed but not included as part of WPML.
Oh well, fixed for now.

September 18, 2019 at 4:23 pm #4598983

chrisC-23

My issue is resolved now. Thank you!