[Bug 19633] New: Uploader.pm / upload.pl -- Use alphanumeric error codes
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19633 Bug ID: 19633 Summary: Uploader.pm / upload.pl -- Use alphanumeric error codes Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org See comment 21 on bug 19420 -- 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=19633 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | -- 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=19633 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=19420 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19633 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=14294 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19633 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Uploader.pm / upload.pl -- |Use alphanumeric error |Use alphanumeric error |codes in upload |codes | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19633 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19633 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 72084 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=72084&action=edit Bug 19633: Use alphanumeric error codes in upload The error codes 1 to 7 are used in Uploader.pm or tools/upload.pl. It would be nice to use alphanumeric codes instead. No behavior change expected. Test plan: [1] Run t/db_dependent/Upload.t [2] Verify that a regular upload with tools/upload.pl still works. [3] Rename upload_path in your koha-conf.xml. Restart Plack, flush the cache and try to upload to a category. Correct error message? [4] Upload the same file twice to the same category. Correct error message the second time? Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19633 Brendan Gallagher <brendan@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=19633 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #72084|0 |1 is obsolete| | --- Comment #2 from Brendan Gallagher <brendan@bywatersolutions.com> --- Created attachment 72919 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=72919&action=edit Bug 19633: Use alphanumeric error codes in upload The error codes 1 to 7 are used in Uploader.pm or tools/upload.pl. It would be nice to use alphanumeric codes instead. No behavior change expected. Test plan: [1] Run t/db_dependent/Upload.t [2] Verify that a regular upload with tools/upload.pl still works. [3] Rename upload_path in your koha-conf.xml. Restart Plack, flush the cache and try to upload to a category. Correct error message? [4] Upload the same file twice to the same category. Correct error message the second time? Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19633 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #72919|0 |1 is obsolete| | --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 74722 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74722&action=edit Bug 19633: Use alphanumeric error codes in upload The error codes 1 to 7 are used in Uploader.pm or tools/upload.pl. It would be nice to use alphanumeric codes instead. No behavior change expected. Test plan: [1] Run t/db_dependent/Upload.t [2] Verify that a regular upload with tools/upload.pl still works. [3] Rename upload_path in your koha-conf.xml. Restart Plack, flush the cache and try to upload to a category. Correct error message? [4] Upload the same file twice to the same category. Correct error message the second time? Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19633 --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Rebased in connection with [% Asset.js("js/file-upload.js") %] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19633 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Ok but I would have written use constant UPLERR_ALREADY_EXISTS => 'UPLERR_ALREADY_EXISTS'; instead of use constant ERRCODE_1 => 'UPLERR_ALREADY_EXISTS'; or even get rid of the constant if only used once. The goal is to make the code more readable, but when you see ERRCODE_X in the perl script you still do not know what it means :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19633 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #5)
Ok but I would have written
use constant UPLERR_ALREADY_EXISTS => 'UPLERR_ALREADY_EXISTS'; instead of use constant ERRCODE_1 => 'UPLERR_ALREADY_EXISTS';
or even get rid of the constant if only used once.
The goal is to make the code more readable, but when you see ERRCODE_X in the perl script you still do not know what it means :)
We still can do that later. This was kind of a safety step in between. Still knowing the old error number.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19633 --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 75856 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=75856&action=edit Bug 19633: (QA follow-up) Really remove these ugly numbers See BZ comment5. We now remove the numbers also from the constant names. Test plan: Read the changes. Git grep "ERRCODE_" Run t/db_dependent/Upload.t (Note: You may see one failure here; it is fixed on bug 20727. So depends on who reaches master first.) Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19633 --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #5)
Ok but I would have written
use constant UPLERR_ALREADY_EXISTS => 'UPLERR_ALREADY_EXISTS'; instead of use constant ERRCODE_1 => 'UPLERR_ALREADY_EXISTS';
or even get rid of the constant if only used once.
The goal is to make the code more readable, but when you see ERRCODE_X in the perl script you still do not know what it means :)
Giving in for high pressure -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19633 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=19633 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #74722|0 |1 is obsolete| | Attachment #75856|0 |1 is obsolete| | --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 77172 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77172&action=edit Bug 19633: Use alphanumeric error codes in upload The error codes 1 to 7 are used in Uploader.pm or tools/upload.pl. It would be nice to use alphanumeric codes instead. No behavior change expected. Test plan: [1] Run t/db_dependent/Upload.t [2] Verify that a regular upload with tools/upload.pl still works. [3] Rename upload_path in your koha-conf.xml. Restart Plack, flush the cache and try to upload to a category. Correct error message? [4] Upload the same file twice to the same category. Correct error message the second time? Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19633 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 77173 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77173&action=edit Bug 19633: (QA follow-up) Really remove these ugly numbers See BZ comment5. We now remove the numbers also from the constant names. Test plan: Read the changes. Git grep "ERRCODE_" Run t/db_dependent/Upload.t (Note: You may see one failure here; it is fixed on bug 20727. So depends on who reaches master first.) Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19633 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |nick@bywatersolutions.com --- Comment #11 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushged to master for 18.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19633 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |martin.renvoize@ptfs-europe | |.com Status|Pushed to Master |RESOLVED --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Enhancement, won't be backported to 18.05.x series. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org