Skip to content

FIX write order line product link as an integer - #33

Open
Pichinov-Jose wants to merge 1 commit into
SplashSync:2.0from
Pichinov-Jose:fix/order-line-product-link-int-type
Open

Pichinov-Jose wants to merge 1 commit into
SplashSync:2.0from
Pichinov-Jose:fix/order-line-product-link-int-type

Conversation

@Pichinov-Jose

Copy link
Copy Markdown

Bug

setValueFrom("fk_product", $productId, "", null, "", "", "none") passes no type, so Dolibarr quotes the value. When the product link is cleared the UPDATE carries fk_product = "".

Under MySQL STRICT_TRANS_TABLES — the default since 5.7 — that is rejected outright. The query fails, nothing is reported to the source, and the line silently keeps the product it had. The sync reports success while the link is unchanged.

Fix

Pass int as the type so Dolibarr emits a numeric value.

Fixes #18. Running in production on a Dolibarr 23.0.0 shop.

🤖 Generated with Claude Code

setValueFrom() is called without a type, so Dolibarr quotes the value and
writes an empty string when the product link is cleared. Under MySQL
STRICT_TRANS_TABLES the UPDATE is rejected and the line silently keeps its
previous product. Passing 'int' makes Dolibarr emit a numeric value.

Closes SplashSync#18

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Order line product link written as '' — breaks on MySQL STRICT_TRANS_TABLES

1 participant