Home›Support›English Support›[Resolved] Conflict with Additional Variation Images Gallery on PHP 8.2 – Deprecated str_contains() error
[Resolved] Conflict with Additional Variation Images Gallery on PHP 8.2 – Deprecated str_contains() error
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing issues with their website breaking on a single product page when WPML String Translation and Additional Variation Images Gallery for WooCommerce are active together on PHP 8.2 or higher. The error logged is a deprecated function in PHP 8.2. Solution: We recommended the client to: 1) Ensure all plugins, including WPML and String Translation, are updated to the latest versions. 2) Deactivate all plugins except for WPML and String Translation, and switch to a standard theme to check if the issue persists. 3) Reactivate plugins one by one to identify any conflicts. 4) If the issue was still unresolved, we provided a code snippet to add to the theme's functions.php file:
Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket.
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.
Thanks for your reply. I can see the issue now. This product hidden link shows up correctly when WPML plugin is deactivated and it's something that shouldn't happen.
Also, if I add a new color and a variation, the product shows up. It looks like some sort of glitch or bug. I will have to escalate this to our 2nd Tier Support for further investigation.
I kindly ask for a snapshot of the site. Alternatively, with your permission, I can create one myself. For this purpose, I typically recommend using the free plugin "Duplicator." If you're already familiar with Duplicator (https://wordpress.org/plugins/duplicator/), please skip the following steps and simply send me the archive file you downloaded.
To guide you further, please adhere to these instructions:
1. View the Duplicator instructions video: hidden link
3. If the archive file exceeds 400MB, please use Duplicator's file filters to exclude cache, wp-uploads directory, media, and archive files.
Once you have the archive file ready, kindly share the link with us. You can utilize platforms like Google Drive, Dropbox, or similar for file sharing, as the snapshot file might be large.
Please note that your next reply will be private, visible only to you and me. You can paste the file link there. Rest assured that once the issue is resolved, I will delete the local site.
Thanks for your reply. I’ve checked, and it seems that some products work fine even when they have multiple variations, for example, this one: hidden link
I don't really understand the logic behind when it works and when it doesn't. I can however rule out that the problem does not occur with products that only come in one color variant.
On the next page, you can see all products and if necessary visit the links: hidden link
I have tried a few things and have noticed the following:
- I made a copy of the product “Homme Vista” (where the page breaks). When I remove all images from both the parent file and variations, the page loads fine (hidden link).
- I made a second copy of the product “Homme Vista” (where the page breaks). When I add a new color to attributes and then create a new variation (from the new color), the page still breaks. But as soon as I add a second variation, the page no longer breaks, which is very confusing (hidden link).
-> So, in my opinion, the problem is located somewhere in the images (product gallery parent & product gallery variations), but not sure of course.
For your information, I have other projects with the same plugin combinations and do not have this problem. I also tried another product gallery plugin, but had the same problem.
At this point, I am considering rebuilding this project from scratch, but this would take an enormous amount of time.
Thanks for your patience. Our 2nd Tier Support checked and he requested that you activate the Elementor Pro plugin on your staging site and update the Elementor Pro to the latest version.
Once you've done that, please notify me and I will share your feedback with our 2nd Tier Support.