Skip to content

Prevent fetched object double wrapping#714

Merged
bbrands02 merged 1 commit intomainfrom
hotfix/prevent-double-wrapping
Apr 15, 2026
Merged

Prevent fetched object double wrapping#714
bbrands02 merged 1 commit intomainfrom
hotfix/prevent-double-wrapping

Conversation

@bbrands02
Copy link
Copy Markdown
Contributor

@bbrands02 bbrands02 commented Apr 14, 2026

prevents
[[object]]

when dealing with a single fetched object

@WilcoLouwerse
Copy link
Copy Markdown
Contributor

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 synchronizeExternToInterngetAllObjectsFromSourcegetAllObjectsFromApi. 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 all resultsPosition values, including _object — so it always returns a proper list regardless of who calls it?

@WilcoLouwerse
Copy link
Copy Markdown
Contributor

Note: all 6 failing CI jobs are unrelated to this PR.

  • PHPCS, PHPStan, PHPMD, Psalm, PHPUnit — runner has PHP 8.1.34 but composer requires >= 8.3. Looks like a missing setup-php step in the workflow.
  • Frontend Quality — transient ECONNRESET during npm install.

These fail on main too.

@bbrands02 bbrands02 merged commit c1d9a89 into main Apr 15, 2026
4 of 10 checks passed
@bbrands02 bbrands02 deleted the hotfix/prevent-double-wrapping branch April 15, 2026 08:44
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.

3 participants