magicbug / Cloudlog

Web based amateur radio logging application built using PHP & MySQL supports general station logging tasks from HF to Microwave with supporting applications to support CAT control.
http://www.cloudlog.co.uk
MIT License
460 stars 190 forks source link

Bug: QSOs with no station_id can only be updated to station_id=1 #2306

Closed int2001 closed 1 year ago

int2001 commented 1 year ago

Describe the bug QSOs without a station_id (set to NULL) can only be updated to station_id=1

To Reproduce Steps to reproduce the behaviour:

  1. Have a QSO without a station_id (modify it in the DB, or upgrade from a very old Version where station_id wasn't populated)
  2. Go To "Station Locations"
  3. A banner will with the following Text will appear: "Due to recent changes within Cloudlog you need to reassign QSOs to your station profiles. Create a station profile, if you haven't already, then press this button to assign all QSOs to the first Station Profile."
  4. If you click to this Button, every QSO without a station_id will be updated to station_id=1.

On Multiuser-instances, that's not good, because every User who calls "Station Locations" ist able to do that. Even if he isn't owner of Station_id=1.

Expected behaviour Don't know. Lets discuss. Ideas so far:

  1. Put that warning to the admin-area, and make all stations-profile selectable there.
  2. Try to match the QSOs with station_callsign/grid to existing station_profiles
  3. ...

i think this is an edge-case and only occurs when you're updating from v1 to a more actual Version. Normally QSOs without a station_id shouldn't exist...

magicbug commented 1 year ago

I'd love to have it so that when importing ADIFs that Cloudlog could figure out the MY fields and check if a locations missing and build it. but yes think a warning might be needed for v1 to v2 i'd hope not many are running v1 now

int2001 commented 1 year ago

100% ACK. but normally there's no way to import ADIFs (or QSOs via API) without a station_id, fixed the last bugs which can cause that (hopefully) in the last release.

so this bug appears only when old qsos without station_id exists.

toco commented 1 year ago

Thanks for filing this after my comment in the draussenfunker Discord @int2001!

Potentially related: I imported some different adifs today and it mentioned that not all fields are valid, but it didn’t say what’s wrong. I’d have to experiment again with the adif files.

I’m not 100% sure if the warning appeared prior to the imports and was caused by a recent instance update or was caused by the imports.

int2001 commented 1 year ago

created a patch for that at https://github.com/magicbug/Cloudlog/pull/2353

Admin can reassign QSOs:

Picture of reassign-GUI