Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter miriadquest

    (@miriadquest)

    In an attempt to highhlight what is changing it we did put this snippet into the site (currently disabled) :

    add_action(‘updated_post_meta’, function($meta_id, $object_id, $meta_key, $meta_value) {
    if (!in_array($meta_key, [‘_stock’, ‘_stock_status’, ‘_backorders’, ‘_manage_stock’], true)) {
    return;
    }

    $sku = get_post_meta($object_id, '_sku', true);
    $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
    
    error_log(
        'PRODUCT META UPDATED | Product ID: ' . $object_id .
        ' | SKU: ' . $sku .
        ' | Key: ' . $meta_key .
        ' | Value: ' . print_r($meta_value, true) .
        ' | Trace: ' . print_r($trace, true)
    );

    }, 10, 4);

    And when we checked the debug log we found the following entries :
    [22-Apr-2026 11:26:53 UTC] PHP Warning: Array to string conversion in /home/mqllife/public_html/wp-content/plugins/code-snippets-pro/php/snippet-ops.php(721) : eval()’d code on line 14
    [22-Apr-2026 11:26:53 UTC] PRODUCT META UPDATED | Product ID: 373382 | SKU: 98656-291 | Key: _stock_status | Value: onbackorder | Trace: Array
    [22-Apr-2026 11:26:53 UTC] PRODUCT UPDATED: 373382

    Which looked to point towards a code snippet doing the change, but we chdecked all teh active snippets and could not fiond one that would be updating the status.
    We even then disabled the code snippet pro plugin itself (in case there was some old snippet in there that we couldn’t see from the UI) and the issue was still happening

    Thread Starter miriadquest

    (@miriadquest)

    Nothing in the logs to indicate what is happening. Since yesterday there are onkly the following entries :
    wc-logger : Just deleting expired logs
    batch-processing : Just : Error processing batch for Order logs deletion process: Processor is enqueued but not scheduled. Background job was probably killed or marked as failed. Reattempting execution
    These two happen all the time. There is one additional error
    wc_get_related_products : Invalid limit type passed to wc_get_related_products. Expected integer, got string with value: “4”

    So nothing top indicate what is changing it

    Thread Starter miriadquest

    (@miriadquest)

    I can confirm that no changes are happening at the time. I can also confirm that our stock levels etc. are managed through a 3rd party plugin (The B2BConnect one).
    This is syncing with our SAP B1 system through appseconnect. This talks to the WOO API to set the stock levels, but this runs once every two hours.
    So I can confirm that the sync job is not causing it as the change from instock to backorder starts happening minutes after I set the status via the db.

    I will get the logs over to you next

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