Bug 22472

Summary: Should column_exists explode if the table does not exist?
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Martin Renvoize <martin.renvoize>
Severity: minor    
Priority: P5 - low CC: katrin.fischer, martin.renvoize, nick
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18936
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.00, 18.11.05
Attachments: Bug 22472: Add tests
Bug 22472: Make column_exists early return if the table does not exist
Bug 22472: Add tests
Bug 22472: Make column_exists early return if the table does not exist
Bug 22472: Add tests
Bug 22472: Make column_exists early return if the table does not exist
Bug 22742: FIX : RenewLoan returns correct datetime format
Bug 22742: FIX : RenewLoan returns correct datetime format

Description Jonathan Druart 2019-03-07 12:13:44 UTC
See bug 18936 comment 33.
If C4::Installer::column_exists is called with a table that has been removed, the methods will print an error.

I think it should early return if the table does not exist (not an exception, we do not want to make more complex the update DB script)
Comment 1 Jonathan Druart 2019-03-07 12:27:33 UTC
Created attachment 86240 [details] [review]
Bug 22472: Add tests
Comment 2 Jonathan Druart 2019-03-07 12:27:39 UTC
Created attachment 86241 [details] [review]
Bug 22472: Make column_exists early return if the table does not exist

On the way we move TableExists to C4::Installer, where it belongs to.
Comment 3 Katrin Fischer 2019-04-04 07:25:33 UTC
Created attachment 87381 [details] [review]
Bug 22472: Add tests

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Katrin Fischer 2019-04-04 07:25:36 UTC
Created attachment 87382 [details] [review]
Bug 22472: Make column_exists early return if the table does not exist

On the way we move TableExists to C4::Installer, where it belongs to.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Katrin Fischer 2019-04-04 07:26:46 UTC
   FAIL	  pod coverage
		POD is missing for TableExists

Is a false positive as the method was only moved in the file. I think renaming it to table_exists might be a nice clean-up, but could be done separately.
Comment 6 Martin Renvoize 2019-04-08 12:52:21 UTC
Created attachment 87512 [details] [review]
Bug 22472: Add tests

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2019-04-08 12:52:23 UTC
Created attachment 87513 [details] [review]
Bug 22472: Make column_exists early return if the table does not exist

On the way we move TableExists to C4::Installer, where it belongs to.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2019-04-08 12:53:13 UTC
Sane and sensible change.. no regressions found and I agree that the function rename would be nice but can be in another bug.

Passing QA
Comment 9 Nick Clemens 2019-04-11 13:57:17 UTC
Awesome work all!

Pushed to master for 19.05
Comment 10 Martin Renvoize 2019-04-15 17:52:06 UTC
Pushed to 18.11.x for 18.11.05
Comment 11 Bin Wen 2019-05-10 19:54:22 UTC
Created attachment 89566 [details] [review]
Bug 22742: FIX : RenewLoan returns correct datetime format

Test plan :
Call RenewLoan a few times and check the date returned is correct (minute wise).

Signed-off-by: Arthur Bousquet <arthur.bousquet@inlibro.com>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Comment 12 Bin Wen 2019-05-10 19:55:54 UTC
Created attachment 89567 [details] [review]
Bug 22742: FIX : RenewLoan returns correct datetime format

Test plan :
Call RenewLoan a few times and check the date returned is correct (minute wise).

Signed-off-by: Arthur Bousquet <arthur.bousquet@inlibro.com>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>

https://bugs.koha-community.org/show_bug.cgi?id=22472