BiologicalRecordsCentre / UKBMS-online

Issue tracking for UKBMS online recording site
2 stars 0 forks source link

problem with the duplicate walk check - year of survey #341

Closed RachaelConway closed 1 month ago

RachaelConway commented 7 months ago

@DavidRoy @IanMiddlebrook When entering date from left to right, it is not possible to enter 2023, as the duplicate check appears to accept '20' as the year, the flag immediately appears after entering 20.

I am getting a duplicate flag for a walk in 2020 when I am trying to enter a walk for 2023, as below

image

Using the calendar avoids the issue, but many users will type in the date.
Typing right to left is a workaround

Thanks

IanMiddlebrook commented 7 months ago

Hi Rachael, I've not been able to replicate this problem. My year field is four figures and fills from right to left, so if I only enter 20, it thinks its the year 20 AD:

image

What does your year field look like on the data entry page? May come down to different browsers or settings?

IanMiddlebrook commented 7 months ago

@DavidRoy @Gary-van-Breda Is it possible there are samples in the database with dates that appear to be from the first century AD?

Gary-van-Breda commented 2 months ago

I believe this is browser setup related. The date control is an HTML5 input type="date": the displayed date is formatted based on the locale of the user's browser. Depending on what browser @RachaelConway is using, and what her local settings are, we may see an issue like this. In the case provided, 22/06/20 is actually a valid shortening of 22/06/2020 which is the date for the walk which is being flagged as a duplicate. (We don't have any 1st century dates). The browser is seeing the typed in 22/06/20, but is presenting to the website the date 22/06/2020. It is a case of the browser being too clever for what we want. This is a known issue with this input type.

We may be able to setup the browser config to prevent this.

@RachaelConway : what type of machine/operating system/browser were you using when you had this problem? Can you take a screenshot of the empty date field, without the popup?

Also what route are you taking to go into the page? (I take it is not through the "My walks" page, as that would automatically fill in the selected date.)

IanMiddlebrook commented 1 month ago

Hi @Gary-van-Breda

This issue has cropped up again - a recorder trying to enter a walk for Snakeholme Pit on 13th May 2024. As soon as they have typed 13/05/2... they get a warning notice about a duplicate walk, which was actually on 12th May 2002. Likewise, when they tried for 26/05/2... they had a warning relate to a walk on 25th May 2002 (not sure why there are one day apart, ignoring the year, unless it's because 2024 is a leap year?).

I was able to replicate this issue - presumably with similar browser settings to the recorder.

They are using the 'Enter Count' route for data entry. I advised them to either type the date before selecting the site name, or to use the calendar icon to select the date.

I just wondered if there was anything more that could be done, beyond checking everyone's browser settings?

Thanks, Ian

Gary-van-Breda commented 1 month ago

Hi @IanMiddlebrook I've changed the underlying event that causes the check to occur - it now won't happen until the user leaves the field, rather than when the date is changed as they are filling it in. When they leave the field, the date should be fully filled in. Fix has been deployed to Live: could you check to see if that works better?

IanMiddlebrook commented 1 month ago

Hi @Gary-van-Breda I've had a bit of fun with this for 13/05/2024 at Snakeholm Pit, but it's still not quite right. If I type the year 2024 really quickly, I get away with it, and no warning comes up. If I start typing more slowly, I get a message as soon as I've typed the 2... It's certainly not waiting for me to leave the field.

Gary-van-Breda commented 1 month ago

Hi @IanMiddlebrook : apologies - I've ensured the caches are cleared, could you try again? If it is still not working, could you give me the ID of the Walk it is saying it is clashing with?

IanMiddlebrook commented 1 month ago

Thanks @Gary-van-Breda - that's sorted it out. I don't need to type so fast any more!