https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42309 --- Comment #5 from Brendan Lawlor <blawlor@clamsnet.org> --- (In reply to Caroline Cyr La Rose from comment #2)
I made the same correction as Jonathan did in bug 42277. (Copying without really understanding what I'm doing, so please let me know if this is not correct! But I figured I could manage a 1-character modification...)
This is called the optional chaining operator. It's used like the . operator for accessing an object's properties or calls to a function. It can be used when the property or the function might not be available, then it returns undefined instead of throwing an error. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/... So in this case when there's no cash registers then the variable crtable isn't initialized and isn't able to call the function DataTable() without returning an error. Test note: It's cool how in the console error the link to cash_registers shows you exactly where the optional chaining was needed, even though the line numbers look way different. Uncaught TypeError: Cannot read properties of undefined (reading 'DataTable') at HTMLDocument.<anonymous> (cash_registers.pl:1612:38) Nice work! Passing QA -- You are receiving this mail because: You are watching all bug changes.