Background of the issue:
I am experiencing a fatal PHP error related to WPML’s class-wpml-element-translation.php when using it alongside the Inspect plugin. The error occurs when loading a page that triggers wpml_object_id_filter or the Inspect plugin’s assets registration. I have implemented a temporary fix by adding a type guard before line 282 in class-wpml-element-translation.php to ensure $element_id is scalar. I am using WordPress version 6.8.1, WPML version 4.7.6, Inspect plugin version 3.0.9, PHP version 8.1, and the Avada theme version 7.12.1. I request a permanent fix in a future WPML release to avoid compatibility issues with plugins like Inspect.
Symptoms:
Fatal error: Uncaught TypeError: Illegal offset type in isset or empty in .../sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php on line 282. The error occurs consistently, breaking the site.
Questions:
Can you provide a permanent fix for the TypeError in WPML’s class-wpml-element-translation.php?
Is there a known compatibility issue between WPML and the Inspect plugin?