isawnyu / pleiades-gazetteer

This repository provides a home for tickets and other planning documents for the Pleiades gazetteer of ancient places. Code is kept in multiple other repositories.
https://pleiades.stoa.org
11 stars 0 forks source link

OSM Import needs to handle id collision more gracefully: 3pts #414

Closed paregorios closed 2 years ago

paregorios commented 4 years ago

Reported by @rmhorne

OSM Import constructs the object ID (Plone "short name") for the location object by URL-cleaning the title string entered in the import dialog box (or the OSM node/way/relation title if the text box was left blank by the user initiating the import). If the resulting ID string matches the ID of another content item (name, location, connection) in the same place context, the import fails with the following error message:

OSM import failed because of an error in parsing coordinate geometry: The id "seriphos" is invalid - it is already in use.

This is not actually an OSM coordinate geometry parse error. It's a thoroughly plone error that is surfaced in the latter portion of the error message.

The following new behavior is desired: Do collision avoidance on generated IDs for locations imported from OSM in the same way that Plone handles ID collisions on generated IDs created through the web: postfix a hyphen and a one-up integer numeral.

paregorios commented 2 years ago

Steps to reproduce:

  1. As an authenticated Pleiades user, navigate to a place page and select the downward error on the "Add Location" button ... Screen Shot 2022-03-21 at 11 21 00 AM
  2. ... which exposes the OSM import interface: Screen Shot 2022-03-21 at 11 22 34 AM
  3. Enter a valid OSM node number and the title "foobar", then select the "Add" button. On the "Add Location" form (which appears after the import), scroll to the bottom and select the "save" button.
  4. Navigate back to the parent place and note that the draft-state location has been created: Screen Shot 2022-03-21 at 11 25 18 AM
  5. Follow the same procedure in 1-4 above a second time and observe the error.

Desired behavior: Do collision avoidance on generated IDs for locations imported from OSM in the same way that Plone handles ID collisions on generated IDs created through the web: postfix a hyphen and a one-up integer numeral.

silviot commented 2 years ago

@paregorios The fix for this is now deployed to staging

paregorios commented 2 years ago

@silviot this is working perfectly on staging. Marking "ready to deploy" to production.

paregorios commented 2 years ago

This is working perfectly on production.