Bug 33300 - Wrong system preference name AutomaticWrongTransfer
Summary: Wrong system preference name AutomaticWrongTransfer
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Fridolin Somers
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 29792
Blocks: 34495
  Show dependency treegraph
 
Reported: 2023-03-22 08:48 UTC by Fridolin Somers
Modified: 2023-12-28 20:47 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.06
Circulation function:


Attachments
Bug 33300: Wrong system preference name AutomaticWrongTransfer (1.98 KB, patch)
2023-03-22 08:58 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 33300: Wrong system preference name AutomaticWrongTransfer (2.03 KB, patch)
2023-03-22 09:29 UTC, David Nind
Details | Diff | Splinter Review
Bug 33300: Wrong system preference name AutomaticWrongTransfer (2.12 KB, patch)
2023-03-23 06:34 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 33300: (follow-up) DBRev for existing databases (2.45 KB, patch)
2023-03-23 07:17 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 33300: (follow-up) DBRev for existing databases (2.51 KB, patch)
2023-04-16 00:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 33300: Wrong system preference name AutomaticWrongTransfer (2.12 KB, patch)
2023-04-18 11:49 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 33300: (follow-up) DBRev for existing databases (2.60 KB, patch)
2023-04-18 11:49 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 33300: [22.05.x] (follow-up) DBRev for existing databases (2.57 KB, patch)
2023-05-16 07:09 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 33300: [22.05.x] Wrong system preference name AutomaticWrongTransfer (2.09 KB, patch)
2023-05-16 07:10 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 33300: [22.05.x] (follow-up) DBRev for existing databases (2.57 KB, patch)
2023-05-16 07:10 UTC, Fridolin Somers
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2023-03-22 08:48:44 UTC
Bug 29792 added a DBRev with new system preference 'AutomaticConfirmTransfer'.

But value in installer/data/mysql/mandatory/sysprefs.sql is wrong :
+('AutomaticWrongTransfer','0',NULL,'Defines whether transfers should be automatically confirmed at checkin if modal dismissed','YesNo'),
Comment 1 Fridolin Somers 2023-03-22 08:50:02 UTC
Since it is 0 by default, I think we do not have to fix recently created databases that do not have this preference, it will be created if enabled.
Comment 2 Fridolin Somers 2023-03-22 08:58:22 UTC
Created attachment 148505 [details] [review]
Bug 33300: Wrong system preference name AutomaticWrongTransfer

Bug 29792 added a DBRev with new system preference 'AutomaticConfirmTransfer'.

But name in installer/data/mysql/mandatory/sysprefs.sql is wrong 'AutomaticWrongTransfer'

Test plan :
Create a new database and check there is in table systempreferences an
entry with variable='AutomaticConfirmTransfer'
Comment 3 David Nind 2023-03-22 09:29:48 UTC
Created attachment 148508 [details] [review]
Bug 33300: Wrong system preference name AutomaticWrongTransfer

Bug 29792 added a DBRev with new system preference 'AutomaticConfirmTransfer'.

But name in installer/data/mysql/mandatory/sysprefs.sql is wrong 'AutomaticWrongTransfer'

Test plan :
Create a new database and check there is in table systempreferences an
entry with variable='AutomaticConfirmTransfer'

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2023-03-22 09:30:15 UTC Comment hidden (obsolete)
Comment 5 David Nind 2023-03-22 09:40:42 UTC
Testing notes using KTD (take 2):

1. Searched system preferences installer file (installer/data/mysql/mandatory/sysprefs.sql)for AutomaticWrongTransfer and AutomaticConfirmTransfer - only AutomaticWrongTransfer is in the file.

2. In the staff interface > Administration > System preferences, search for AutomaticWrongTransfer and AutomaticConfirmTransfer - only AutomaticConfirmTransfer is found.

3. Search the database for the two system preferences - only AutomaticWrongTransfer is found - SQL queries:
   . select * from systempreferences where variable = "AutomaticWrongTransfer";
   . select * from systempreferences where variable = "AutomaticConfirmTransfer";

4. Edit the system preference AutomaticConfirmTransfer in the staff interface - change "Don't" to "Do".

5. Search the database again as in step 3 - both system preferences now exist found.

6. Apply the patch.

7. Run reset_all

8. Note that:
   . When searching installer/data/mysql/mandatory/sysprefs.sql (as per step 1), only AutomaticConfirmTransfer is now found.
   . When searching the database (as per step 3), only AutomaticConfirmTransfer is now found.
   . If you change AutomaticConfirmTransfer in the staff interface (as per step 2 and 3), the value is updated for AutomaticConfirmTransfer.
Comment 6 Jonathan Druart 2023-03-22 13:21:09 UTC
(In reply to Fridolin Somers from comment #1)
> Since it is 0 by default, I think we do not have to fix recently created
> databases that do not have this preference, it will be created if enabled.

I think we should remove the existing one and create the correct one.
Comment 7 Fridolin Somers 2023-03-22 19:55:52 UTC
OK, like for bug 33297 ?
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148504
Comment 8 Marcel de Rooy 2023-03-23 06:34:37 UTC
Created attachment 148581 [details] [review]
Bug 33300: Wrong system preference name AutomaticWrongTransfer

Bug 29792 added a DBRev with new system preference 'AutomaticConfirmTransfer'.

But name in installer/data/mysql/mandatory/sysprefs.sql is wrong 'AutomaticWrongTransfer'

Test plan :
Create a new database and check there is in table systempreferences an
entry with variable='AutomaticConfirmTransfer'

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 9 Marcel de Rooy 2023-03-23 06:36:16 UTC
(In reply to Jonathan Druart from comment #6)
> (In reply to Fridolin Somers from comment #1)
> > Since it is 0 by default, I think we do not have to fix recently created
> > databases that do not have this preference, it will be created if enabled.
> 
> I think we should remove the existing one and create the correct one.

No blocker for me, but I would say yes, add a trivial dbrev too. Last word to RM.
Comment 10 Fridolin Somers 2023-03-23 07:17:28 UTC
Created attachment 148585 [details] [review]
Bug 33300: (follow-up) DBRev for existing databases

Test plan :
1.1) Start from a Koha 22.05
1.2) Upgrade to master
=> Check the upgrade says :
   Wrong system preference 'AutomaticWrongTransfer' renamed 'AutomaticConfirmTransfer'
2.1) Start from a Koha 22.05
2.2) Upgrade to 22.11
2.3) Via interface change system preference 'AutomaticConfirmTransfer' and save
2.4) Upgrade to master
=> Check the upgrade says :
   Wrong system preference 'AutomaticWrongTransfer' deleted
Comment 11 David Cook 2023-03-30 06:01:09 UTC
Hoping to look at these soon...
Comment 12 Katrin Fischer 2023-04-16 00:02:37 UTC
Created attachment 149721 [details] [review]
Bug 33300: (follow-up) DBRev for existing databases

Test plan :
1.1) Start from a Koha 22.05
1.2) Upgrade to master
=> Check the upgrade says :
   Wrong system preference 'AutomaticWrongTransfer' renamed 'AutomaticConfirmTransfer'
2.1) Start from a Koha 22.05
2.2) Upgrade to 22.11
2.3) Via interface change system preference 'AutomaticConfirmTransfer' and save
2.4) Upgrade to master
=> Check the upgrade says :
   Wrong system preference 'AutomaticWrongTransfer' deleted

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Marcel de Rooy 2023-04-18 11:48:19 UTC
What you actually need, is:
UPDATE systempreferences SET variable='AutomaticConfirmTransfer' WHERE variable='AutomaticWrongTransfer'
This works always. No need to count, delete, etc.
You could even catch the number of updated recs.
No blocker, just noting for next time :)
Comment 14 Marcel de Rooy 2023-04-18 11:49:00 UTC
Created attachment 149793 [details] [review]
Bug 33300: Wrong system preference name AutomaticWrongTransfer

Bug 29792 added a DBRev with new system preference 'AutomaticConfirmTransfer'.

But name in installer/data/mysql/mandatory/sysprefs.sql is wrong 'AutomaticWrongTransfer'

Test plan :
Create a new database and check there is in table systempreferences an
entry with variable='AutomaticConfirmTransfer'

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 15 Marcel de Rooy 2023-04-18 11:49:03 UTC
Created attachment 149794 [details] [review]
Bug 33300: (follow-up) DBRev for existing databases

Test plan :
1.1) Start from a Koha 22.05
1.2) Upgrade to master
=> Check the upgrade says :
   Wrong system preference 'AutomaticWrongTransfer' renamed 'AutomaticConfirmTransfer'
2.1) Start from a Koha 22.05
2.2) Upgrade to 22.11
2.3) Via interface change system preference 'AutomaticConfirmTransfer' and save
2.4) Upgrade to master
=> Check the upgrade says :
   Wrong system preference 'AutomaticWrongTransfer' deleted

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 16 Tomás Cohen Arazi (tcohen) 2023-04-24 13:50:02 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 17 Fridolin Somers 2023-05-04 20:45:16 UTC
Please backport this.
Comment 18 Jacob O'Mara 2023-05-10 12:54:38 UTC
Nice work, thanks everyone!

Pushed to 22.11.x for the next release.
Comment 19 Lucas Gass (lukeg) 2023-05-15 21:17:44 UTC
Doesn't apply cleanly to 22.05.x, if needed please rebase.
Comment 20 Fridolin Somers 2023-05-16 07:09:11 UTC
Created attachment 151246 [details] [review]
Bug 33300: [22.05.x] (follow-up) DBRev for existing databases

Test plan :
1.1) Start from a Koha 22.05
1.2) Upgrade to master
=> Check the upgrade says :
   Wrong system preference 'AutomaticWrongTransfer' renamed 'AutomaticConfirmTransfer'
2.1) Start from a Koha 22.05
2.2) Upgrade to 22.11
2.3) Via interface change system preference 'AutomaticConfirmTransfer' and save
2.4) Upgrade to master
=> Check the upgrade says :
   Wrong system preference 'AutomaticWrongTransfer' deleted

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 21 Fridolin Somers 2023-05-16 07:10:00 UTC
Created attachment 151247 [details] [review]
Bug 33300: [22.05.x] Wrong system preference name AutomaticWrongTransfer

Bug 29792 added a DBRev with new system preference 'AutomaticConfirmTransfer'.

But name in installer/data/mysql/mandatory/sysprefs.sql is wrong 'AutomaticWrongTransfer'

Test plan :
Create a new database and check there is in table systempreferences an
entry with variable='AutomaticConfirmTransfer'

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 22 Fridolin Somers 2023-05-16 07:10:03 UTC
Created attachment 151248 [details] [review]
Bug 33300: [22.05.x] (follow-up) DBRev for existing databases

Test plan :
1.1) Start from a Koha 22.05
1.2) Upgrade to master
=> Check the upgrade says :
   Wrong system preference 'AutomaticWrongTransfer' renamed 'AutomaticConfirmTransfer'
2.1) Start from a Koha 22.05
2.2) Upgrade to 22.11
2.3) Via interface change system preference 'AutomaticConfirmTransfer' and save
2.4) Upgrade to master
=> Check the upgrade says :
   Wrong system preference 'AutomaticWrongTransfer' deleted

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 23 Fridolin Somers 2023-05-16 07:11:20 UTC
(In reply to Lucas Gass from comment #19)
> Doesn't apply cleanly to 22.05.x, if needed please rebase.

Here are the patches.
This is needed where Bug 29792 as been pushed : 22.11.00,22.05.10, 21.11.18