Open ianwallen opened 1 year ago
@ianwallen I am not sure, can you tell me is the 2004
the result of change? And date that is handled as ISODate in core-geonework is suspect to timezone challenges around midnight at the end of the year. While these were fixed for GeoNetwork 4 the issue remains unpatched for geonetwork 3.12.x.
Update: Sorry I misunderstood your example, you changed the record on 2023-02-28
and this issue is three weeks old.
I still recommend adding some breakpoints to ISODate and seeing how 2023-02-28 was created.
@jodygarnett All I did was import a record that had the correct dates for the thesaurus. I verified the date by exporting xml. I then used the editor to edit and save the metadata (I did not make any changes - just load metadata in editor and clicked on save) All thesaurus dates were changed by the editor to be the last modified date.
My understanding is that the gmd:thesaurusName dates are related to the thesaurus and they should not be changed to the lastmodified date of the metadata record.
The last modified date was embedder in the core Geonetwork
Finally it passed to the xslt for the transformation
The question is where the change is supposed to be.
I am still looking at how the transformation side picked that date. Will give more details
The question is if we really want to get rid of setting last modify date. We could just remove the logic in core Geonetwork about the last modify part.
It should only be setting dates if the dates are not already set.
The problem is that the xsl is rebuilding the complete section afaik, so needs to extract the values from somewhere.
An option, not optimal, would be to keep current behaviour, but add in update-fixed-info.xsl
a rule to process that thesaurus section and fix the dates.
A better option, but will require some Java changes would be to store the dates in the thesaurus file and retrieve both. Currently, seems some logic for that, but only stores 1 value and applies a formatting to the date, that changes the original value also:
I'll try the update-fixed-info.xsl
change for now.
@josegar74 @ianwallen
I put two PR to fix this issue. I tested from my local and its fine.
This PR https://github.com/geonetwork/core-geonetwork/pull/6972 will add extra flag on Java side stating this date is file system date not the real thesaurus date.
This PR in HNAP is to parse the date or discard it. https://github.com/metadata101/iso19139.ca.HNAP/pull/327
Here is a metadata record that I edited and just saved the changed. You can see that the data associated to the thesaurus was changes to the date in which the record was saved.
I believe the date of the thesaurus is not supposed to change when saving data as this is the date related to the thesaurus.