Whenever I report anything to WPML, I get new tasks for myself from them. I just do not have the time to work that much for paid plugins anytime they request. I would be a happy customer in case they ever start to investigate or debug something, but in the past they never fixed bugs in a reasonable time frame. It took months or years for every reported bug. Long story short: Here is the reply from my paid developer:
***
In wp-content/plugins/woocommerce-composite-products/includes/class-wp-cp-display.php
in der Funktion show_composited_product()
wird mit mit dem aktivierten Multilingualplugin im Parameter $product_id
NULL
übergeben.
Die anschlie?ende Suche mit $composite->get_composited_product()
gibt dann false
zurück, woraufhin dann false->get_product()
aufgerufen wird, wodurch die Fehlermeldung could not cal function on bool
zustande kam.
Meine Vermutung ist, dass das Multilingualplugin den leeren String oder den String '0'
, welche die Funktion show_composited_product()
behandeln kann, in den Wert NULL
“übersetzt” und damit den Fehler ausl?st.
Also Workaround habe ich die Funktion so modifizert, dass sie auch mit NULL
klarkommt. Ein Patch ist im Anhang.
Der richtige Fix w?re eine Anpassung des Multilingualplugins.
***
…/woocommerce-composite-products/includes/class-wc-cp-display.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff –git a/wp/wp-content/plugins/woocommerce-composite-products/includes/class-wc-cp-display.php b/wp/wp-content/plugins/woocommerce-composite-products/includes/class-wc-cp-display.php
index ee86b68..c65d4ff 100755
— a/wp/wp-content/plugins/woocommerce-composite-products/includes/class-wc-cp-display.php
+++ b/wp/wp-content/plugins/woocommerce-composite-products/includes/class-wc-cp-display.php
@@ -153,7 +153,7 @@ class WC_CP_Display {
*/
public function show_composited_product( $product_id, $component_id, $composite ) {
– if ( $product_id === ‘0’ || $product_id === ” ) {
+ if ( $product_id === NULL || $product_id === ‘0’ || $product_id === ” ) {
return ‘<div class=”component_data” data-component_set=”true” data-price=”0″ data-regular_price=”0″ data-product_type=”none” style=”display:none;”></div>’;