BiologicalRecordsCentre / PoMS

repository for Pollinator Monitoring Scheme website
0 stars 0 forks source link

Unable to add 1km square data in Northern Ireland #142

Closed kitenetter closed 2 years ago

kitenetter commented 2 years ago

We seem to be unable to enter data for Northern Ireland - the 1km squares are set up but we're getting an error message that the precise grids don't match to the 1km square, even though it looks like they should.

image

andrewvanbreda commented 2 years ago

@kitenetter I will check this.

My guess is, I think it may have been generally added to Indicia and PoMS is picking up the change and it is working incorrectly. I am a bit confused why the Indicia code appears to have updated on UKPomS

I will check after I have finished what I am doing, so that will be this afternoon.

andrewvanbreda commented 2 years ago

@kitenetter I know code for this was added to general Indicia for the Butterfly site, and it would have ended up on PoMS after an upgrade such as the Drupal 9 upgrade.

However I cannot get that message to appear on my machine, even with identical data.

Are you able to write down the exact steps that cause the message to appear.

kitenetter commented 2 years ago
  1. Log on to UK PoMS
  2. Go to Add your results - 1km pan-trap samples
  3. Select a square in NI, e.g. "J1181 Antrim"
  4. Click on map (within displayed 1km square) to add a more precise grid ref, e.g. J116812
  5. Fill in all the mandatory attributes
  6. Click save

The error message then appears: "Please ensure the precise grid reference is inside the 1km square."

Using Firefox.

andrewvanbreda commented 2 years ago

@kitenetter This is kind of fixed ( I have disabled the message) I hadn't realised the message only shows on save as the code I was thinking maybe at fault appears before save. It is another problem. The problem is there is some code in there that does that validation that doesn't work for Irish Grid. My guess is it originates from the forms on iRecord as I can see it isn't my code style.

For now I just disabled that, but will try to change it to only fire when OSGB is selected.

The whole way it works is reliant on OSGB, so would need to be completely different to cope with Irish grid.

I will make that change so it only fires for OSGB when I go on test site next....I don't want to put that kind of change straight live.

You should be able to submit the data anyway.

By the way, I notice the year on the grids on the site default filter to 2021, did you want that to now be 2022?

kitenetter commented 2 years ago

Thanks @andrewvanbreda that will be fine for now and we can get the NI data entered.

I was expecting/hoping that the filters and grids (e.g. on the Map of FIT Counts) would automatically default to the current year. The current year seems to be given in the dropdown for the filter but it the map and grid are defaulting to 2021. Would be good to fix this - let me know if you want a new issue for it.

andrewvanbreda commented 2 years ago

@kitenetter I will change this for EU PoMS then move it across. This is because originally not even the near year appear automatically, I think the default was left, perhaps because I didn't think of it.

The forms have been changed now so that the validation is limited to OSGB, that is now live.

Close when happy.

kitenetter commented 2 years ago

Thanks - closing