Bug 22729 - flgAnonymized shouldn't be NULL and should be renamed anonymized
Summary: flgAnonymized shouldn't be NULL and should be renamed anonymized
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on: 21336
Blocks:
  Show dependency treegraph
 
Reported: 2019-04-17 17:47 UTC by Tomás Cohen Arazi
Modified: 2019-04-26 15:12 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.05.00


Attachments
Bug 22729: Adapt Koha::Patron(s) and tests (4.20 KB, patch)
2019-04-17 18:18 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 22729: DBIC update (3.48 KB, patch)
2019-04-17 18:18 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 22729: Adapt /patrons controller code to the change (2.06 KB, patch)
2019-04-17 18:18 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 22729: Add dbrev to rename column (incl kohastructure) (2.83 KB, patch)
2019-04-19 08:26 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 22729: [DO_NOT_PUSH] DBIC update (3.58 KB, patch)
2019-04-19 09:33 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 22729: Adapt Koha::Patron(s) and tests (4.30 KB, patch)
2019-04-19 09:33 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 22729: Adapt /patrons controller code to the change (2.15 KB, patch)
2019-04-19 09:33 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 22729: DB update (2.80 KB, patch)
2019-04-19 11:59 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 22729: DB update (2.85 KB, patch)
2019-04-19 12:04 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 22729: [DO_NOT_PUSH] DBIC update (3.60 KB, patch)
2019-04-19 12:04 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 22729: Adapt Koha::Patron(s) and tests (4.31 KB, patch)
2019-04-19 12:05 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 22729: Adapt /patrons controller code to the change (2.17 KB, patch)
2019-04-19 12:05 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 22729: DB update (2.91 KB, patch)
2019-04-25 07:18 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22729: [DO_NOT_PUSH] DBIC update (3.66 KB, patch)
2019-04-25 07:18 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22729: Adapt Koha::Patron(s) and tests (4.38 KB, patch)
2019-04-25 07:18 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22729: Adapt /patrons controller code to the change (2.23 KB, patch)
2019-04-25 07:18 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22729: (QA follow-up) Ensure no NULL values before setting NOT NULL (1.48 KB, patch)
2019-04-25 07:18 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22729: (RM follow-up) Correct column in schema addition (786 bytes, patch)
2019-04-25 10:11 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2019-04-17 17:47:16 UTC
What the title says :-D
Comment 1 Tomás Cohen Arazi 2019-04-17 18:18:01 UTC
Created attachment 88222 [details] [review]
Bug 22729: Adapt Koha::Patron(s) and tests

This patch adapts the Koha::Patron(s) code to the column change.
To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Patrons.t
=> SUCCESS: Tests pass!
- Sign off :-D
Comment 2 Tomás Cohen Arazi 2019-04-17 18:18:04 UTC
Created attachment 88223 [details] [review]
Bug 22729: DBIC update

I add this DBIC update because I didn't manage to add the +anonymize =>
{ is_boolean => 1 } change without the schema updating script to bark
because of the non-existent column...
Comment 3 Tomás Cohen Arazi 2019-04-17 18:18:07 UTC
Created attachment 88224 [details] [review]
Bug 22729: Adapt /patrons controller code to the change

This patch makes the controller code aware of the flgAnonymized =>
anonymized change.

To test:
- Run
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass!
- Sign off :-D
Comment 4 Marcel de Rooy 2019-04-19 08:03:04 UTC
Testing here now
Comment 5 Marcel de Rooy 2019-04-19 08:26:19 UTC
Created attachment 88337 [details] [review]
Bug 22729: Add dbrev to rename column (incl kohastructure)

Speaks for itself.

Test plan:
Run the dbrev.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Marcel de Rooy 2019-04-19 09:15:32 UTC
Hmm Running Koha/Patrons.t with perl twice no problem, but running with prove the second time results in a failure. Sql mode ?

    #   Failed test 'With BorrowerLogs and TrackLastPatronActivity we should not spam the logs'
    #   at t/db_dependent/Koha/Patrons.t line 1477.
    #          got: '2'
    #     expected: '1'
t/db_dependent/Koha/Patrons.t .. 31/39     # Looks like you failed 1 test of 4.
Comment 7 Marcel de Rooy 2019-04-19 09:30:42 UTC
This should resolve the second prove:

diff --git a/Koha/Patron.pm b/Koha/Patron.pm
index 6a25d717c1..90c4f38853 100644
--- a/Koha/Patron.pm
+++ b/Koha/Patron.pm
@@ -752,7 +752,7 @@ sub track_login {
     return if
         !$params->{force} &&
         !C4::Context->preference('TrackLastPatronActivity');
-    $self->lastseen( dt_from_string() )->store;
+    $self->lastseen( dt_from_string() )->SUPER::store;
 }

 =head3 move_to_deleted

Obviously, there is a relation with Koha::Patron's sub store too.
Safe to say that it is not directly related to this patch. We should resolve it on a new report. Opened report 22741.
Comment 8 Marcel de Rooy 2019-04-19 09:33:33 UTC
Created attachment 88338 [details] [review]
Bug 22729: [DO_NOT_PUSH] DBIC update

I add this DBIC update because I didn't manage to add the +anonymize =>
{ is_boolean => 1 } change without the schema updating script to bark
because of the non-existent column...

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 9 Marcel de Rooy 2019-04-19 09:33:38 UTC
Created attachment 88339 [details] [review]
Bug 22729: Adapt Koha::Patron(s) and tests

This patch adapts the Koha::Patron(s) code to the column change.
To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Patrons.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 10 Marcel de Rooy 2019-04-19 09:33:42 UTC
Created attachment 88340 [details] [review]
Bug 22729: Adapt /patrons controller code to the change

This patch makes the controller code aware of the flgAnonymized =>
anonymized change.

To test:
- Run
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 11 Tomás Cohen Arazi 2019-04-19 11:59:12 UTC
Marcel, I missed to upload the dbrev patch I originally wrote, and it differs from yours as I made it NOT NULL also.
Comment 12 Tomás Cohen Arazi 2019-04-19 11:59:38 UTC
Created attachment 88349 [details] [review]
Bug 22729: DB update
Comment 13 Tomás Cohen Arazi 2019-04-19 12:04:35 UTC
Created attachment 88350 [details] [review]
Bug 22729: DB update

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 14 Tomás Cohen Arazi 2019-04-19 12:04:50 UTC
Created attachment 88351 [details] [review]
Bug 22729: [DO_NOT_PUSH] DBIC update

I add this DBIC update because I didn't manage to add the +anonymize =>
{ is_boolean => 1 } change without the schema updating script to bark
because of the non-existent column...

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 15 Tomás Cohen Arazi 2019-04-19 12:05:01 UTC
Created attachment 88352 [details] [review]
Bug 22729: Adapt Koha::Patron(s) and tests

This patch adapts the Koha::Patron(s) code to the column change.
To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Patrons.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 16 Tomás Cohen Arazi 2019-04-19 12:05:21 UTC
Created attachment 88353 [details] [review]
Bug 22729: Adapt /patrons controller code to the change

This patch makes the controller code aware of the flgAnonymized =>
anonymized change.

To test:
- Run
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 17 Martin Renvoize 2019-04-25 07:18:04 UTC
Created attachment 88692 [details] [review]
Bug 22729: DB update

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 18 Martin Renvoize 2019-04-25 07:18:07 UTC
Created attachment 88693 [details] [review]
Bug 22729: [DO_NOT_PUSH] DBIC update

I add this DBIC update because I didn't manage to add the +anonymize =>
{ is_boolean => 1 } change without the schema updating script to bark
because of the non-existent column...

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 19 Martin Renvoize 2019-04-25 07:18:10 UTC
Created attachment 88694 [details] [review]
Bug 22729: Adapt Koha::Patron(s) and tests

This patch adapts the Koha::Patron(s) code to the column change.
To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Patrons.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 20 Martin Renvoize 2019-04-25 07:18:13 UTC
Created attachment 88695 [details] [review]
Bug 22729: Adapt /patrons controller code to the change

This patch makes the controller code aware of the flgAnonymized =>
anonymized change.

To test:
- Run
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 21 Martin Renvoize 2019-04-25 07:18:16 UTC
Created attachment 88696 [details] [review]
Bug 22729: (QA follow-up) Ensure no NULL values before setting NOT NULL

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 22 Martin Renvoize 2019-04-25 07:19:23 UTC
Great work, Passing QA
Comment 23 Nick Clemens 2019-04-25 10:11:53 UTC
Created attachment 88745 [details] [review]
Bug 22729: (RM follow-up) Correct column in schema addition
Comment 24 Nick Clemens 2019-04-25 11:58:29 UTC
Awesome work all!

Pushed to master for 19.05
Comment 25 Martin Renvoize 2019-04-26 15:12:50 UTC
Bug in enhancement not in 18.11.x series.