Bug 16217 - Notice' names may have diverged
Summary: Notice' names may have diverged
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 11867
Blocks: 12752
  Show dependency treegraph
 
Reported: 2016-04-06 16:01 UTC by Jonathan Druart
Modified: 2016-12-05 21:25 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16217: Resync names of notices (2.22 KB, patch)
2016-04-06 16:05 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16217: Resync names of notices (2.33 KB, patch)
2016-04-19 06:48 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16217: Resync names of notices (1.76 KB, patch)
2016-04-26 15:13 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16217: Resync names of notices (1.79 KB, patch)
2016-04-26 17:46 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 16217: Resync names of notices (1.92 KB, patch)
2016-04-26 18:32 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 16217: Resync names of notices (2.01 KB, patch)
2016-04-28 07:53 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2016-04-06 16:01:10 UTC
Bug 12752 has fixed a bug for installations upgrading from 3.14, but has not fixed the problem for new installations.
Because of some wrong data manipulations, the names for a given letter code may diverge.

In particular OVERDUE and PREDUE names of phone notices have been wrongly modify by bug 11867.
Comment 1 Jonathan Druart 2016-04-06 16:05:28 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2016-04-06 21:49:05 UTC
Comment on attachment 49997 [details] [review]
Bug 16217: Resync names of notices

Review of attachment 49997 [details] [review]:
-----------------------------------------------------------------

::: installer/data/mysql/updatedatabase.pl
@@ +12211,4 @@
>      SetVersion($DBversion);
>  }
>  
> +$DBversion = "XXX";

Atomic update .perl instead?
Comment 3 Jonathan Druart 2016-04-19 06:48:40 UTC Comment hidden (obsolete)
Comment 4 Bernardo Gonzalez Kriegel 2016-04-26 02:12:38 UTC
(In reply to M. Tompsett from comment #2)
> 
> Atomic update .perl instead?

I think it's needed. 
Currently it does not apply
Comment 5 Jonathan Druart 2016-04-26 15:13:41 UTC Comment hidden (obsolete)
Comment 6 Bernardo Gonzalez Kriegel 2016-04-26 16:36:49 UTC
Now applies but...

I run
insert into letter select module,code,branchcode,'New advance name',is_html,title,content,'print' from letter where code = 'PREDUE'

Then
SELECT code, name, message_transport_type from letter WHERE code='PREDUE' OR code='OVERDUE' gives
+--------+----------------------------+------------------------+
| code   | name                       | message_transport_type |
+--------+----------------------------+------------------------+
| PREDUE | Advance Notice of Item Due | email                  |
| PREDUE | New advance name           | print                  |
+--------+----------------------------+------------------------+

This is the case we are trying to fix, isn't it?

Running perl installer/data/mysql/updatedatabase.pl
DEV atomic update: bug_16217.perl

does not fix this. 
Am I doing the right test?
Comment 7 Jonathan Druart 2016-04-26 17:46:56 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2016-04-26 17:47:28 UTC
Sorry, 
  my $dbh = C4::Context->dbh
was missing in the .perl file.
Comment 9 Bernardo Gonzalez Kriegel 2016-04-26 18:32:24 UTC Comment hidden (obsolete)
Comment 10 Bernardo Gonzalez Kriegel 2016-04-26 18:39:22 UTC
(In reply to Jonathan Druart from comment #8)
> Sorry, 
>   my $dbh = C4::Context->dbh
> was missing in the .perl file.

NP, I never made an atomic .perl, did not know it was necessary.
Regards
Comment 11 Marcel de Rooy 2016-04-27 10:05:06 UTC
Jonathan:
Shouldn't we repair some old db revs here too, if that is possible?
If you didn't upgrade yet, can we do it right in the first run?
Comment 12 Katrin Fischer 2016-04-27 10:06:41 UTC
Hi Marcel, we are looking at the same bugs again - take a look at bug 12752 for the database update entry fix! Can you finish here?
Comment 13 Marcel de Rooy 2016-04-28 07:42:12 UTC
(In reply to Katrin Fischer from comment #12)
> Hi Marcel, we are looking at the same bugs again - take a look at bug 12752
> for the database update entry fix! Can you finish here?

OK I will continue here now.
Comment 14 Marcel de Rooy 2016-04-28 07:53:41 UTC
Created attachment 50877 [details] [review]
Bug 16217: Resync names of notices

Bug 12752 has fixed a bug for installations upgrading from 3.14, but has
not fixed the problem for new installations.
Because of some wrong data manipulations, the names for a given letter
code may diverge.

In particular OVERDUE and PREDUE names of phone notices have been
wrongly modify by bug 11867: they have been set to the name of the first HOLD
notice.

Trying to be back on our feet, this update DB entry will try to guess
and set back up the correct name.

To know if your install is affected by this bug, the following SQL query
can help you:
  SELECT code, name, message_transport_type
  FROM letter
  WHERE code="PREDUE" OR code="OVERDUE";

If the names are different for the same code, something went wrong.
Executing this update DB entry should fix the divergence.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Fix the problem, see comment #6 for test.
No koha-qa errors

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 15 Marcel de Rooy 2016-04-28 07:54:56 UTC
Passed QA
Note that all notice names are considered, not only DUE/PREDUE.
Comment 16 Brendan Gallagher 2016-04-29 02:28:12 UTC
Pushed to Master - Should be in the May 2016 Release.  Thanks!
Comment 17 Julian Maurice 2016-05-09 08:22:46 UTC
Patch pushed to 3.22.x, will be in 3.22.7