[Bug 36196] New: Handling NULL data in ajax calls for cities
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Bug ID: 36196 Summary: Handling NULL data in ajax calls for cities Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: thibaud.guillot@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Hello all, Just a simple patch here, I had the case recently, if a data is null in the cities table, the datatable won't handle the data well and will load indefinitely. I've added a condition so that it can be displayed despite NULL data. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Thibaud Guillot <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |thibaud.guillot@biblibre.co |ity.org |m -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Thibaud Guillot <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 --- Comment #1 from Thibaud Guillot <thibaud.guillot@biblibre.com> --- Created attachment 162535 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162535&action=edit Bug 36196 : Handling NULL data on ajax call Test plan: 1) Update some data in your cities table, sample for one send: "UPDATE cities SET city_state=NULL WHERE cityid=<id>" 2) Go on "/cgi-bin/koha/admin/cities.pl" and wait a entire life :) 3) Apply this patch 4) Rebuild your po files if needed 5) Reload the same page and now you get normally the datatable Sponsored by : BibLibre -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 --- Comment #2 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 162551 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162551&action=edit Bug 36196: Handling NULL data on ajax call Test plan: 1) Update some data in your cities table, sample for one send: "UPDATE cities SET city_state=NULL WHERE cityid=<id>" 2) Go on "/cgi-bin/koha/admin/cities.pl" and wait a entire life :) 3) Apply this patch 4) Rebuild your po files if needed 5) Reload the same page and now you get normally the datatable Sponsored by : BibLibre -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162551|0 |1 is obsolete| | --- Comment #3 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 162552 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162552&action=edit Bug 36196: Handling NULL data on ajax call Test plan: 1) Update some data in your cities table, sample for one send: "UPDATE cities SET city_state=NULL WHERE cityid=<id>" 2) Go on "/cgi-bin/koha/admin/cities.pl" and wait a entire life :) 3) Apply this patch 4) Rebuild your po files if needed 5) Reload the same page and now you get normally the datatable Sponsored by : BibLibre Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Attachment #162535|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net QA Contact|testopia@bugs.koha-communit |victor@tuxayo.net |y.org | --- Comment #4 from Victor Grousset/tuxayo <victor@tuxayo.net> --- This seem to be the proper way to handle null values: https://stackoverflow.com/questions/48917064/how-do-you-properly-handle-null... Hopefully that works in our case.
From reading quickly: Adding «"defaultContent": ""» And maybe having to change our "targets" value if for some reason it only work with '_all' (and that we somehow can get away without [0,1,2,3,4])
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #5 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Another source: https://stackoverflow.com/questions/57711349/how-to-deal-with-null-values-in... --- And another. According to the usage of defaultContent there, we can even target individual columns for default values: https://datatables.net/forums/discussion/50823/handling-null-values So it seems pretty sure we can use that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 --- Comment #6 from Thibaud Guillot <thibaud.guillot@biblibre.com> --- Hi, Thanks Victor for your feedback, I think that will be better too... to be honest I look into the code and I found the same behavior in identity_providers.tt#L419.. I will modify this -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |baptiste.wojtkowski@biblibr | |e.com --- Comment #7 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- Hello, The way this fixes the behaviour for default seems standard in koha : koha@koha-dev:~/src$ git grep -C1 "return data.escapeHtml();" koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt- if ( data != null ) { koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt: return data.escapeHtml(); koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt- } -- koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt- if ( type == 'display' ) { koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt: return data.escapeHtml(); koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt- } -- koha-tmpl/intranet-tmpl/prog/en/modules/admin/identity_provider_domains.tt- if ( data != null ) { koha-tmpl/intranet-tmpl/prog/en/modules/admin/identity_provider_domains.tt: return data.escapeHtml(); koha-tmpl/intranet-tmpl/prog/en/modules/admin/identity_provider_domains.tt- } -- koha-tmpl/intranet-tmpl/prog/en/modules/admin/identity_provider_domains.tt- if ( data != null ) { koha-tmpl/intranet-tmpl/prog/en/modules/admin/identity_provider_domains.tt: return data.escapeHtml(); koha-tmpl/intranet-tmpl/prog/en/modules/admin/identity_provider_domains.tt- } -- koha-tmpl/intranet-tmpl/prog/en/modules/admin/identity_providers.tt- if ( data != null ) { koha-tmpl/intranet-tmpl/prog/en/modules/admin/identity_providers.tt: return data.escapeHtml(); koha-tmpl/intranet-tmpl/prog/en/modules/admin/identity_providers.tt- } -- koha-tmpl/intranet-tmpl/prog/en/modules/admin/smtp_servers.tt- if ( data != null ) { koha-tmpl/intranet-tmpl/prog/en/modules/admin/smtp_servers.tt: return data.escapeHtml(); koha-tmpl/intranet-tmpl/prog/en/modules/admin/smtp_servers.tt- } -- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt- if ( data != null ) { koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt: return data.escapeHtml(); koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt- } -- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt- if ( data && type == 'display' ) { koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt: return data.escapeHtml(); koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt- } -- koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt- if (data != null) { koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt: return data.escapeHtml(); koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt- } else { -- koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt- if ( data != null ) { koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt: return data.escapeHtml(); koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt- } Since this ticket aims at fixing a broken functionnality, couldn't we just pass QA for this one and consider changing the way it works in general in another ticket ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162552|0 |1 is obsolete| | --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 169699 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169699&action=edit Bug 36196: Handling NULL data on ajax call Test plan: 1) Update some data in your cities table, sample for one send: "UPDATE cities SET city_state=NULL WHERE cityid=<id>" 2) Go on "/cgi-bin/koha/admin/cities.pl" and wait a entire life :) 3) Apply this patch 4) Rebuild your po files if needed 5) Reload the same page and now you get normally the datatable Sponsored by: BibLibre Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |37492 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37492 [Bug 37492] We should set datatable defaults for possible null returns -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Passing QA here and moved the discussion around defaultContent to a new wider bug.. we should certainly consider it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|victor@tuxayo.net |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |24.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Thanks for all the hard work! Pushed to main for the next 24.11.00 release as RM Assistant -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 --- Comment #11 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Thanks Martin, I was considering not blocking on that issue and letting other QA people chip in, you rear my mind :) And thanks for the new ticket.
The way this fixes the behaviour for default seems standard in koha :
(In reply to Baptiste Wojtkowski (bwoj) from comment #7) We have a lot of unofficial standards and sometimes it's a trap ^^" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|24.11.00 |24.11.00,24.05.04 released in| | --- Comment #12 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 24.05.x for upcoming 24.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|24.11.00,24.05.04 |24.11.00,24.05.04,23.11.09 released in| | --- Comment #13 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.09 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #14 from wainuiwitikapark@catalyst.net.nz --- Not backporting to 23.05.x unless requested -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36196 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Needs documenting --- Comment #15 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11 unless requested -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org