Page 1 of 1

Logfile edits not saving

Posted: Sun 08 Jan 2023 4:22 pm
by freddie
I'm using the monthly logfile editor to remove some spurious humidity spikes and my edits aren't saving. I see this in the MXdiags logfile:

Code: Select all

2023-01-08 16:12:56.039 api/edit: Unexpected Error, Description: "Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index"
On clicking "save" in the editor it causes the above in the logs.

I have tried a forced refresh of the page, and also opening the editor in an incognito window.

Running the latest version - 3.23.0 build 3220. It hasn't worked at all since I upgraded on the 2nd Jan - but have only just tried it in the past couple of days. It was working prior to the 2nd Jan.

When I upgrade I install to a clean directory and copy across the data folder and any other configuration/data items required.

Re: Logfile edits not saving

Posted: Sun 08 Jan 2023 9:50 pm
by mcrossley
I'll take a look at this later, sorry but family issues mean I'm likely to be offline at least most of this week.

Re: Logfile edits not saving

Posted: Sun 08 Jan 2023 10:39 pm
by freddie
mcrossley wrote: Sun 08 Jan 2023 9:50 pm I'll take a look at this later, sorry but family issues mean I'm likely to be offline at least most of this week.
Okay, no rush - I can always edit manually. Family comes first.

Re: Logfile edits not saving

Posted: Mon 09 Jan 2023 2:40 pm
by mcrossley
No fix, but I had time to try a quick edit and it worked OK on my system - and afaik that code hasn't been touched in the while.

A basic check would be the line number shown on the display/edit screens does exist in the file itself.

Otherwise, I'm back in the car this afternoon, I may have time to look at it in more detail tomorrow.

Re: Logfile edits not saving

Posted: Mon 09 Jan 2023 2:45 pm
by broadstairs
I did try this yesterday and it failed for me as well on the first line of the file. Don't know if it's relevant but this is on Linux. I'll test again today just in case I made a mistake somewhere.

Stuart

I just tried this again a couple of times and it fails for me with that same message about the index.

Re: Logfile edits not saving

Posted: Tue 10 Jan 2023 12:05 pm
by mcrossley
I looked at this a bit more closely. The error is coming from the surrounding code that handles the browser response.

The page JS was changed to allow for multiselection, do you have the previous version of the JS cached?
If you haven't already, please try clearing your browser cache for the CMX site - or for start the browser dev tools, which unless you have changed it automatically disables the use of cached files.

Re: Logfile edits not saving

Posted: Tue 10 Jan 2023 12:40 pm
by freddie
Using dev tools I see this:

Code: Select all

Uncaught SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at altEditor._editRowCallback (dataTables.altEditor.free.js:907:70)
    at Object.success (dataTables.altEditor.free.js:391:62)
    at c (jquery-latest.min.js:2:28327)
    at Object.fireWith [as resolveWith] (jquery-latest.min.js:2:29072)
    at l (jquery-latest.min.js:2:79901)
    at XMLHttpRequest.<anonymous> (jquery-latest.min.js:2:82355)
dataTables.altEditor.free.js:385 {0: '10366', 1: '08/01/23', 2: '13:43', 3: '6.5', 4: '85', 5: '4.2', 6: '8.8', 7: '13.7', 8: '199', 9: '0.0', 10: '0.4', 11: '986.29', 12: '28.4', 13: '15.8', 14: '67', 15: '8.2', 16: '3.4', 17: '6.5', 18: '0.0', 19: '0', 20: '0.00', 21: '0.00', 22: '2.2', 23: '123', 24: '0.0', 25: '201', 26: '0.0', 27: '2.0', 28: '3.4', 29: '6.5', undefined: '', editRowBtn: ''}
FWIW I am editing entries 4 and 5 of the array, and can see my changed values in there.

Also, this is in an incognito window.

Re: Logfile edits not saving

Posted: Tue 10 Jan 2023 2:48 pm
by mcrossley
Doh!

Thanks, for some reason I was looking at the dayfile editor! :bash:
Yes, the log file editor is broken, now fixed in the next patch release.

Re: Logfile edits not saving

Posted: Tue 10 Jan 2023 3:05 pm
by freddie
mcrossley wrote: Tue 10 Jan 2023 2:48 pm Yes, the log file editor is broken, now fixed in the next patch release.
Brilliant, thanks Mark.

Re: Logfile edits not saving

Posted: Thu 12 Jan 2023 9:21 am
by cliftonweather
Just updated to 3221 and this still does not seem to be working for the Extra data log viewer/editor.
When I try to edit a record I get:-

2023-01-12 09:13:48.637 api/edit: Unexpected Error, Description: "Object reference not set to an instance of an object."

Re: Logfile edits not saving

Posted: Thu 12 Jan 2023 12:53 pm
by water01
Me To

Code: Select all

2023-01-12 12:50:56.630 api/edit: Unexpected Error, Description: "Object reference not set to an instance of an object."
2023-01-12 12:51:04.541 api/edit: Unexpected Error, Description: "Object reference not set to an instance of an object."

Re: Logfile edits not saving

Posted: Thu 12 Jan 2023 2:22 pm
by mcrossley
Doh! I forgot to check if affects the Extra data log editor as well, it looks like it does. :roll:

Re: Logfile edits not saving

Posted: Thu 12 Jan 2023 3:54 pm
by freddie
Monthly data log editor working now - thanks for the quick fix :)

Re: Logfile edits not saving

Posted: Thu 12 Jan 2023 4:41 pm
by mcrossley
The fix for the Extra Data Logs editor is just the JavaScript file in the interface folder.

Sorry, I have been juggling three different versions of the interface files due to some upcoming improvements and the wrong one has ended up in the zip.

I have now completely separated the three versions so it shouldn't(!) happen again.

The file goes in /interface/js

Re: Logfile edits not saving

Posted: Thu 12 Jan 2023 6:40 pm
by water01
Tested and it works Mark.