Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter illmonkey

    (@illmonkey)

    UPDATE – Issue Resolved

    I found the root cause of this issue. It wasn’t directly related to the plugin update, but rather exposed an existing data inconsistency in my database.

    The Problem: Some products in my database had an empty string ("") stored for their rating value instead of a numeric 0. The previous version of the plugin apparently handled this gracefully through PHP’s type juggling, but the latest update is more strict about type checking (which is actually better practice).

    The Solution: I ran a database query to fix the inconsistent data:

    sql

    UPDATE wp_postmeta 
    SET meta_value = '0' 
    WHERE meta_key = '_wc_average_rating' 
    AND meta_value = '';

    After cleaning up the database, the error is completely resolved.

    Root Cause: It’s unclear how these empty strings got into the database in the first place – possibly from:

    • A previous WooCommerce or plugin version
    • Manual database manipulation
    • Import/migration issues
    • Another plugin conflict

    Recommendation for Plugin Developers: While this was a data issue on my end, you might consider adding a type check/conversion in the get_star_rating_svg() function to handle edge cases like this:

    php

    // Ensure rating is numeric
    $rating = is_numeric($rating) ? (float)$rating : 0;

    This would make the plugin more robust against database inconsistencies.

    Issue Status: RESOLVED

    Thanks for your attention to this matter!

    Thread Starter illmonkey

    (@illmonkey)

    Hello,

    i have made a new test page: https://test.lgm-beschlag.de/produkt/hat/

    • WordPress 6.5.2
    • Woocommerce 8.8.2
    • Elementor 3.21.3
    • Elementor Pro 3.21.1
    • Additional Variation Images Gallery for WooCommerce 1.3.22
    Thread Starter illmonkey

    (@illmonkey)

    yes it looks the same

    Thread Starter illmonkey

    (@illmonkey)

    Ich habe den Fehler nun gefunden. Jemand hatte mit ACF die Felder width, length und height angelegt. Da diese schon in WC vorhanden sind hat das zu dem Fehler geführt das immer die field_id vom ACF geladen wurde statt dem Wert. Und da die Buchstaben im Backend aus dem String entfernt wurden konnte ich die zahl auch nicht in der Datenbank finden. Damit erklärt sich dann auch der Fehler das “sting * float” bei euch nicht funktioniert. Trotzdem Danke für die Hilfe.

    Thread Starter illmonkey

    (@illmonkey)

    Hallo, wie geschrieben erstelle und aktualisiere ich meine Artikel über die Rest API. Die werte für Länge, Breite und Höhe werden von mir NICHT übergeben. Die Felder für dimensions sind in meinem Put request nicht vorhanden.

    Wenn ich nach dem wert 6486585982 in der gesamten Datenbank suche bekomme ich nur Einträge aus der Tabelle wp_woocommerce_gzd_shipment_itemmeta. Dort habe ich 37 Einträge mit dem meta_key “_length” und dem Wert. Hei Höhe und Breite ist es genauso. Die werte Variieren über verschiedene Artikel, aber es sind immer hohe nummern die willkürlich auftauchen. Aber auch nicht bei allen Artikeln. Ich kann kein Muster erkennen.

    Wenn ich im Backend die Wert für Länge mit einem Testwert Überscheibe finden ich in der Datenbank bei wp_postmeta einen Eintrag _shipping_length bei dem Artikel. bei Versandmaße wird mir der Wert dann auch richtig angezeigt. Das normale Längenfeld wird aber nicht gespeichert. Dort steht immer noch die random Nummer.

Viewing 5 replies - 1 through 5 (of 5 total)