Skip to content

[Bug]: Fix swapped latitude/longitude in AsGeopoint preview - #716

Closed
fashxp wants to merge 1 commit into
2026.xfrom
fix/447-asgeopoint-preview
Closed

fashxp wants to merge 1 commit into
2026.xfrom
fix/447-asgeopoint-preview

Conversation

@fashxp

@fashxp fashxp commented Oct 21, 2026

Copy link
Copy Markdown
Member

What

AsGeopoint::generateResultPreview() now prints the latitude after Lat.: and the longitude after Long.:.

Why

The preview used getLongitude() for the Lat. label and getLatitude() for Long., 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.
Fixes #447

Verification

  • Unit/regression: FactoryOperatorTest::testAsGeopointPreviewLabelsLatitudeAndLongitude fails on base 3d43f44 (Lat.: 2.3522 Long.: 48.8566), passes on 042d9d9 (run on the host with the committed test method; the Codeception suite itself needs the kernel/DB and was not run).
  • Static: php-cs-fixer (--allow-risky=yes) clean on the changed source file; PHPStan not run (swap of two getter calls, no type change).
  • E2E (Studio, dev-2026.x): Data Hub mapping > Advanced > Transformations preview, CSV row lat=48.8566 / lon=2.3522. Base shows Lat.: 2.3522 Long.: 48.8566, fix shows Lat.: 48.8566 Long.: 2.3522.

Not verified

The classic admin; the import itself (code reading only, process() is unchanged); the full Codeception suite in CI.

🤖 Generated with Claude Code

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>
@fashxp fashxp added the Bug label Oct 21, 2026
@sonarqubecloud

Copy link
Copy Markdown

@fashxp
fashxp marked this pull request as ready for review October 21, 2026 19:10
Copilot AI balanced review requested due to automatic review settings October 21, 2026 19:10
@fashxp fashxp self-assigned this Oct 21, 2026
@fashxp fashxp added this to the 2026.4.0 milestone Oct 21, 2026
@fashxp

fashxp commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

Superseded by #720, which carries the same change on 2026.3.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The localized correction fixes the label swap and includes a targeted regression test, with no unresolved findings.

No open issues 🎉

What changed in this PR

Corrects swapped latitude/longitude labels in the AsGeopoint mapping preview without changing import behavior.

Changes:

  • Uses the matching coordinate getter for each preview label (src/Mapping/Operator/Factory/AsGeopoint.php:44).
  • Adds a regression test with distinct latitude and longitude values (tests/unit/FactoryOperatorTest.php:438–446).

The full Codeception suite was not verified.

File Description
tests/​unit/​FactoryOperatorTest.php Adds regression coverage for preview labels.
src/​Mapping/​Operator/​Factory/​AsGeopoint.php Corrects coordinate getters in preview output.

Review effort: Balanced

@github-actions github-actions Bot locked and limited conversation to collaborators Oct 21, 2026
@fashxp fashxp removed this from the 2026.4.0 milestone Oct 21, 2026
@fashxp
fashxp deleted the fix/447-asgeopoint-preview branch October 21, 2026 20:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Incorrect preview for AsGeopoint Mapping operator

2 participants