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
450 stars 189 forks source link

Error on Distances Worked page #1360

Closed ofadam closed 2 years ago

ofadam commented 2 years ago

When using the latest version of the "station_logbook" branch, I get an "undefined" error in red on the Distances Worked page regardless of the band selected.

AndreasK79 commented 2 years ago

I just noticed this yesterday as well. I pushed a fix. Pull the latest code and report back if it works.

ofadam commented 2 years ago

Just pulled the latest code and I'm still getting the error.

AndreasK79 commented 2 years ago

Ok. The commit solved my problem.

Can you open devtools (F12) and click on network. Go back to Cloudlog and click plot. You will see a call to get_distances in devtools. Click on it and then preview. Check there if you see an error message.

ofadam commented 2 years ago

Loads of errors! Here are the first of many:

`

A PHP Error was encountered

Severity: Warning

Message: A non-numeric value encountered

Filename: models/Distances_model.php

Line Number: 70

A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 260

Filename: models/Distances_model.php

Line Number: 73

A PHP Error was encountered

Severity: Notice

Message: Trying to access array offset on value of type null

Filename: models/Distances_model.php

Line Number: 73

A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 260

Filename: models/Distances_model.php

Line Number: 73

A PHP Error was encountered

Severity: Notice

Message: Undefined index: count

Filename: models/Distances_model.php

Line Number: 73

A PHP Error was encountered

Severity: Notice

Message: Undefined index: callcount

Filename: models/Distances_model.php

Line Number: 75

`
AndreasK79 commented 2 years ago

@ofadam thanks. Another bug it seems. I think I managed to reproduce it here. It has to do with 2 or more stations locations, where one of them doesn't have any QSOs on the band chosen. I'll get back to you when I have a fix you can try,

AndreasK79 commented 2 years ago

@ofadam give the latest commit on station_logbooks a go, and report back the result.

ofadam commented 2 years ago

That did the trick! Thanks so much.

magicbug commented 2 years ago

@AndreasK79 HF fixed however Sats still broken

"All" returns "undefined"

AndreasK79 commented 2 years ago

@ofadam great.

@magicbug can't reproduce here. Can you dig up some error messages? I can plot "All" fine here.

magicbug commented 2 years ago

When I do "SAT" "ALL" and click plot it returns

{ "Error": "No QSOs found to plot." }

Which cant be right as there's 11946q in the logbook!

AndreasK79 commented 2 years ago

That doesn't make sense. Though I can't really tell why it's doing this in your case.

That message is returned two places in Distances_model: line 15 and line 59. I'm not sure I can manage to figure this one out without remote debugging, or you take a look yourself.

magicbug commented 2 years ago

I'll have a poke around see if I can fix it