Skip to content

Fix latitude2 is not converted to lat2text in workbench#8100

Open
alesan99 wants to merge 1 commit into
mainfrom
issue-8099
Open

Fix latitude2 is not converted to lat2text in workbench#8100
alesan99 wants to merge 1 commit into
mainfrom
issue-8099

Conversation

@alesan99
Copy link
Copy Markdown
Contributor

@alesan99 alesan99 commented May 19, 2026

Fixes #8099

In batch edit, latitude2 field should now take the value from lat2text

Look at this PR for more detailed info: #7379

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add pr to documentation list
  • Add automated tests

Testing instructions

  • Create a query with locality as a base table. Include one or more of the coordinate decimal fields (Latitude 1, Longitude 1, Latitude 2, and/or Longitude 2) in the Query. Make sure you have localities with values filled in latitude2 and longitude2.
  • Run the query and click batch edit
  • See that the lat2text column is present and readonly, and that latitude2 uses the value from lat2text

Summary by CodeRabbit

  • Bug Fixes
    • Corrected coordinate field handling for the second latitude decimal in batch edit operations, ensuring accurate data rewriting and proper alignment with corresponding text representations.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

📝 Walkthrough

Walkthrough

This PR fixes a typo in the coordinate-field replacement mapping for batch edit queries. The key latiude2 is corrected to latitude2 so that the second latitude decimal field is properly converted to its text representation (lat2text), aligning with the behavior of other coordinate fields.

Changes

Coordinate field mapping correction

Layer / File(s) Summary
Latitude2 text field mapping fix
specifyweb/backend/stored_queries/batch_edit.py
The replacement mapping key is corrected from the misspelled latiude2 to latitude2 to align the decimal coordinate field with its corresponding text field representation.
🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Automatic Tests ⚠️ Warning No tests verify the latitude2→lat2text conversion fix. The test_batch_edit.py file lacks tests for rewrite_coordinate_fields() or the field_replacement_map dictionary. Add a test verifying rewrite_coordinate_fields() converts latitude2, longitude1/2 to their text equivalents (lat1text, long1text, lat2text, long2text).
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: correcting the latitude2 field conversion to lat2text in the workbench batch edit view.
Linked Issues check ✅ Passed The code change directly fixes the reported typo in issue #8099 by correcting the replacement map key from 'latiude2' to 'latitude2' mapping to 'lat2text'.
Out of Scope Changes check ✅ Passed The change is narrowly focused on fixing the specific typo in the coordinate field rewriting logic with no extraneous modifications.
Testing Instructions ✅ Passed Testing instructions are clear and accurately cover the typo fix affecting latitude2/lat2text coordinate field conversion in batch edit workbench views.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-8099

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@alesan99 alesan99 added this to the 7.12.1 milestone May 19, 2026
@alesan99 alesan99 requested a review from a team May 19, 2026 18:51
Copy link
Copy Markdown
Contributor

@Iwantexpresso Iwantexpresso left a comment

Choose a reason for hiding this comment

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

  • See that the lat2text column is present and readonly , and that latitude2 uses the value from lat2text

  • just tested it on sp7demofish. I didn't run into any issues, nice work !

@Iwantexpresso Iwantexpresso requested a review from a team May 19, 2026 20:25
Copy link
Copy Markdown
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

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

  • See that the lat2text column is present and readonly, and that latitude2 uses the value from lat2text

Looks good, value is properly copied over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋Back Log

Development

Successfully merging this pull request may close these issues.

latitude2 is not converted to lat2text in workbench

3 participants