Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: America/Los_Angeles (GMT-08:00)

Tagged: 

This topic contains 10 replies, has 2 voices.

Last updated by Bobby 6 months, 1 week ago.

Assisted by: Bobby.

Author Posts
May 9, 2024 at 3:52 am #15608293

desireeM

WPML 4.6.10

class OTGS_Products_Config_Xml
in

private function load_configuration( $xml_file ) {

:
file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated

Because potentially you pass null to it from

new OTGS_Products_Config_Xml( $this->get_xml_config_file() );

which can be null if neither file exists

---

Then additionally in that case, because you assign null, you'll get tons of errors from various places, e.g. same file

foreach ( $this->repositories_config as $repository_config ) {
May 9, 2024 at 5:36 pm #15611790

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you for sharing the above with us!

Please share with me the full error you are getting from the error log.

You can see how to enable debug logging here

May 10, 2024 at 9:12 am #15613592

desireeM
PHP Error: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated
File: /path/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/installer/includes/products/OTGS_Products_Config_Xml.php on line 23
Trace:
#0 /path/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/installer/includes/products/OTGS_Products_Config_Xml.php (23): file_exists( $filename = NULL )
#1 /path/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/installer/includes/products/OTGS_Products_Config_Xml.php (14): OTGS_Products_Config_Xml->load_configuration( $xml_file = NULL )
#2 /path/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/installer/includes/class-wp-installer.php (282): OTGS_Products_Config_Xml->__construct( $xml_file = NULL )
#3 /path/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/installer/includes/class-wp-installer.php (107): WP_Installer->prepare_products_config_xml()
#4 /path/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/installer/includes/class-wp-installer.php (87): WP_Installer->__construct()
#5 /path/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/installer/includes/functions-core.php (6): WP_Installer::instance()
#6 /path/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/installer/installer.php (15): WP_Installer()
#7 /path/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/installer/loader.php (228): include_once( /path/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/installer/installer.php )
#8 /path/wp-includes/class-wp-hook.php (324): wpml_installer_instance_delegator()
#9 /path/wp-includes/class-wp-hook.php (348): WP_Hook->apply_filters( $value = NULL, $args = Array( [0] =>  ) )
#10 /path/wp-includes/plugin.php (redacted): WP_Hook->do_action( $args = Array( [0] =>  ) )
#11 /path/wp-settings.php (redacted): do_action( $hook_name = after_setup_theme )
#12 /path/wp-config.php (redacted): require_once( /path/wp-settings.php )
#13 /path/wp-load.php (redacted): require_once( /path/wp-config.php )

Line numbers in provided trace might be off by X or redacted for security reasons, but line in error is factual.

May 10, 2024 at 7:05 pm #15616236

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you for sharing the error log with me.

Please verify that the rest of the WPML add-ons are up to date (Plugins->Add new->Commercial tab-> Check for updates )

Then do the following and let me know your results

- Go to WPML > Support
- Troubleshoot
- Click on the button: Clear cache in WPML
- Click on the button: Remove ghost entries from translation tables
- Click click on the button: Determine language information
- Click on the button: Fix term count
- Click on the button: Fix input type assignments for translations

NOTE: Always have a recent and working backup before making any changes recommended by our team or a 3rd party

May 11, 2024 at 11:21 pm #15617260

desireeM

Everything's up to date already.

May 13, 2024 at 9:55 pm #15622633

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Were you able to run the Troubleshooting actions?

I would like to request temporary access (wp-admin and FTP) to your site to test the issue.
(preferably to a test site where the problem has been replicated if possible)

**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **

I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.

NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.

Thank you,
Bobby

May 14, 2024 at 9:03 am #15624256

desireeM

Can you please describe the steps you tried to reproduce the issue on your end? Because it seems you a) didn't look at the code and b) didn't reproduce it as outlayed in the OP

>which can be null if neither file exists

Did you delete the file (repositories.xml) and then still weren't able to reproduce the issue?

May 14, 2024 at 11:05 pm #15627265

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

"Did you delete the file (repositories.xml) and then still weren't able to reproduce the issue?"

Yes, deleting this file from /sitepress-multilingual-cms/vendor/otgs/repositories.xml or renaming it will trigger this notice.

Deprecated: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated in /var/www/sites/pretty-trumpet/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/installer/includes/products/OTGS_Products_Config_Xml.php on line 23

Just to verify, are you able to trigger this PHP notice with different steps as well?

If yes, please share them with me clearly so I can communicate with our team.

May 15, 2024 at 11:57 am #15630002

desireeM

Yes, if for whatever reason the file isn't accessible to the current PHP user, e.g. due to wrong permissions,...

Anyway, it doesn't matter, just check for !== null before you call file_exists and the bug is fixed.
Takes 1 minute

May 16, 2024 at 12:47 am #15632523

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you, will update you once I have more feedback.

May 16, 2024 at 5:50 pm #15636612

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi there,

I have discussed this with our team and the conclusion is that without this file WPML will not function properly thus the warnings, therefore it would not be ideal to handle these warnings, rather we should investigate what is causing the file to either not exist/deleted or not to be readable on your environment.

Is this something that you can reproduce without manually adjusting the code?

The topic ‘[Closed] OTGS PHP notices’ is closed to new replies.