Repository navigation
[Bug]: Fix swapped latitude/longitude in AsGeopoint preview - #720
Merged
Merged
Conversation
The preview printed the longitude under 'Lat.' and the latitude under 'Long.'. The imported value was already correct; only the text changes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The narrowly scoped correction fixes the label mismatch and includes a targeted regression test, with no unresolved findings.
No open issues 🎉
What changed in this PR
Corrects swapped latitude and longitude values in the shared AsGeopoint preview formatter, addressing #447 without changing import processing.
Changes:
- Pairs each preview label with the correct coordinate getter.
- Adds a regression test using distinct latitude and longitude values.
The fix addresses the root cause at the formatter boundary without changing signatures or return shapes. No documentation or changelog changes are included. Tests were not run during this review.
| File | Description |
|---|---|
| tests/unit/FactoryOperatorTest.php | Adds the preview-label regression test at lines 438–446. |
| src/Mapping/Operator/Factory/AsGeopoint.php | Corrects the getter-to-label pairing at line 44. |
Review effort: Balanced
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



What
AsGeopoint::generateResultPreview()now prints the latitude afterLat.:and the longitude afterLong.:.Why
The preview used
getLongitude()for theLat.label andgetLatitude()forLong., so the mapping preview showed the values swapped.process()was already correct (GeoCoordinates(lat, lon)), so imported data is unaffected; only the preview text changes.This is the same change as the earlier PR #716 (2026.x), re-cut on 2026.3 as a clean cherry-pick of 042d9d9 (2 files, +11/-1, no conflicts); #716 is closed in favour of this one.
Fixes #447
Verification
FactoryOperatorTest::testAsGeopointPreviewLabelsLatitudeAndLongitude. On the host with the 2026.3 source: base givesLat.: 2.3522 Long.: 48.8566, the fix givesLat.: 48.8566 Long.: 2.3522.Not verified
The Studio e2e on 2026.3 itself; the classic admin; the import itself (code reading only,
process()is unchanged); the full Codeception suite (CI runs it on this PR).