fix: avoid edge case error message in log #1117
Open
+534
−25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
in some edge case I've get Error in dolibarr log
2024-10-29 14:57:01 ERR 89.91.85.217 Error, you call sanitizeVal() with a bad value for the check type. Data can't be sanitized.
2024-10-29 15:00:42 ERR 89.91.85.217 DoliDBMysqli::query SQL Error query: SELECT t.rowid,t.date_creation,t.tms,t.import_key,t.status,t.role,t.gender,t.civility,t.firstname,t.lastname,t.job
,t.email,t.phone,t.society_name,t.signature_date,t.signature_location,t.signature_comment,t.element_id,t.element_type,t.module_name,t.signature,t.stamp,t.signature_url,t.transaction_url,t.last_em
ail_sent_date,t.attendance,t.object_type,t.fk_object FROM llx_saturne_object_signature as t WHERE 1 = 1 AND t.entity IN (1) AND fk_object = AND status > 0 AND object_type = "user" AND role = "Us
erSignature" LIMIT 1
2024-10-29 15:00:42 ERR 89.91.85.217 DoliDBMysqli::query SQL Error message: DB_ERROR_SYNTAX You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server v
ersion for the right syntax to use near 'AND status > 0 AND object_type = "user" AND role = "UserSignature" LIMIT 1' at line 1
if fk_object is not defined => better to do not run SQL query => it's better than have error in log