You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nice fix for the double-wrapping issue — array_is_list() is the right guard here.
Two things I noticed:
1. Indentation mismatch
The new blocks at both locations use tabs where the surrounding code uses spaces. Visible in the diff — the if block around line 632 and the replacement around line 1949 are tab-indented inside space-indented context. Worth fixing before merge.
2. Wrapping logic split across two methods
The call chain is synchronizeExternToIntern → getAllObjectsFromSource → getAllObjectsFromApi. With this change, the _object wrapping is skipped in getAllObjectsFromApi and handled by the caller instead. That works, but it means anyone calling getAllObjectsFromApi directly won't get the normalization for _object results.
Would it be cleaner to keep all the normalization in getAllObjectsFromApi — i.e., do the array_is_list() check there for allresultsPosition values, including _object — so it always returns a proper list regardless of who calls it?
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
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.
prevents
[[object]]
when dealing with a single fetched object