Repository navigation
#1154 [API] fix: list hooks accept any object, the shipments REST API sends a stdClass - #1155
Merged
nicolas-eoxia merged 1 commit intoOct 22, 2026
Conversation
…T API sends a stdClass
api_shipments.class.php passes new stdClass() to printFieldListWhere as soon
as sqlfilters is given: the ?CommonObject type hint of the reedcrm list hooks
ended every GET /api/index.php/shipments?sqlfilters=... in a 500 (TypeError),
seen twice on a client production, an external integration following the
shipments of a customer.
- printFieldListWhere, printFieldListSelect, printFieldListSearch and
isLifecycleColumn take ?object
- isLifecycleColumn checks isset($object->element) before reading it
Replayed Shipments->index('t.date_creation', 'DESC', 5, 0, '',
'(t.fk_soc:=:...)') on a copy of the client database: TypeError before,
2 shipments returned after, no PHP warning.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #1154
Problème
expedition/class/api_shipments.class.php(cœur 23.0.4, l. 146) passenew stdClass()au hookprintFieldListWheredès qu'unsqlfiltersest fourni. Les hooks de liste de reedcrm étaient typés?CommonObject: chaqueGET /api/index.php/shipments?sqlfilters=…répondait 500 (TypeError … must be an instance of CommonObject or null, instance of stdClass given). Vu deux fois sur une prod client (19/10 et 22/10) : une intégration externe qui suit les expéditions d'un client.Correctif
printFieldListWhere,printFieldListSelect,printFieldListSearchetisLifecycleColumnprennent?object.isLifecycleColumnvérifieisset($object->element)avant de le lire (sinon « Undefined property » sur un stdClass).Vérifié sur une copie de la base du client
Shipments->index('t.date_creation', 'DESC', 5, 0, '', '(t.fk_soc:=:…)')rejoué en CLI, chaque version dans son processus :TypeError: Argument 2 passed to ActionsReedcrm::printFieldListWhere() …🤖 Generated with Claude Code