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
447 stars 188 forks source link

SQL fails when dxcc is null #3168

Open sipsmi opened 1 month ago

sipsmi commented 1 month ago

https://github.com/magicbug/Cloudlog/blob/c874ec994c280ac35bde7989ee6f166c3b1caa2b/application/models/Logbook_model.php#L4337

This has been discussed, sometimes when typing in a callsign when login a QSO the lookup fails and the log shows an error since the call to get_entity can be null for unworked callsigns.

I work around this with if ( ! isset($dxcc) || empty($dxcc)) { return '' ; }

as the first line in the get_entity function.

It seems a safe thing to do - can it be added?

Thanks

magicbug commented 1 month ago

If DXCC isn't set best bet might be set to none that's what happens in the QSO entry window if you select DXCC of none it sets it to "0"