DOI-USGS / fort-pymdwizard

The MetadataWizard is a useful tool designed to facilitate FGDC metadata creation for spatial and non-spatial data sets. It is a cross-platform desktop application built using an open-source Python architecture.
https://usgs.github.io/fort-pymdwizard/
Other
63 stars 22 forks source link

Crashes when click on FGDC Validation Errors list - specifically (udom) cannot be empty #122

Closed esellers-usgs closed 2 years ago

esellers-usgs commented 3 years ago

Using wizard v2.0.6 (Windows OS).

  1. Open FGDC xml metadata file and run Validation.
  2. Validation popup displays, summarizing number of errors in this record. image
  3. Click OK and detailed "FGDC Validation Errors" popup displays - listing each error (see e.g. below). image
  4. Click on the first-listed error, and corresponding field in Identification tab is highlighted red.
  5. Click on the second-listed error: (udom) cannot be empty - and the wizard crashes.
  6. (Clicking on the third or fourth-listed error: (attrdef) cannot be empty - does not cause a crash/field is highlighted in Entity and Attribute tab as expected. Same with clicking on fifth-listed error).

e.g. The value for Contact Voice Telephone (cntvoice) cannot be empty The value for Unrepresentable Domain (udom) cannot be empty The value for Attribute Definition (attrdef) cannot be empty The value for Attribute Definition (attrdef) cannot be empty The value for Contact Voice Telephone (cntvoice) cannot be empty

Example metadata file available for private internal USGS distribution only, upon request.

dignizio-usgs commented 2 years ago

@esellers-usgs - can you confirm: was this resolved for you in the latest release (v2.0.7)?

esellers-usgs commented 2 years ago

@dignizio-usgs - It looks like the original issue reported here is fixed. The Windows desktop client (MW v2.0.7) no longer crashes and successfully highlights the affected fields, BUT now it displays an error dialog for each reported validation error that reads:

"We encountered a problem highlighting and navigating to that error. The xpath of the xml error is: metadata/eainfo/detailed[2]/attr[12]/attrdomv/udom"

image

Github won't let me attach/upload the test metadata.xml file here but I can email it to whomever if needed to help reproduce.

dignizio-usgs commented 2 years ago

That's interesting in that the dialogue displays an error, and indicates an issue showing where that error is, yet your screen grab does show those the specific empty 'udom' elements being highlighted in red, corresponding to the 3 flagged schema errors.

For clarity, this is an actual schema error. So, the bug is just in the tool's ability to drop a user back into the part of the UI where that specific element can be edited?

If you click 'OK' on the message, does the tool allow you to go into those fields and add the required value (some text)?

This is a bit of a quirk in the CSDGM schema where the description of the values provided for the 'udom' has to have something in it... so the element might be the redundant and repeat the same text provided in the 'attrdef' element, or generic text saying "Please review the description provided in the Attribute Definition field" so that the schema error resolves.

image

If you're able to close the warning and continue editing in the tool, I will close the issue. But we'll make a note of this for @ennsk and @tnorkin to ensure those error messages aren't incorrectly displaying, and that the 'nav to error' functionality works as expected.

esellers-usgs commented 2 years ago

@dignizio-usgs Exactly, it is highlighting the offending fields, and does allow me to edit them. I can either click through each warning and make edits in the offending fields and/or close the warning dialog, make the edits, save, and re-run the validation, which subsequently does not return any validation errors. So I think you can close this ticket and just note the error dialog that the user probably doesn't need to be seeing. But it would be good to know what is triggering it.

dignizio-usgs commented 2 years ago

OK thanks for the follow up. Got it, it's sort of an error message when they're really ought not be one at this point, as it seems to be working as needed.