Bug 34844 - manage_item_editor_templates is missing from userpermissions.sql
Summary: manage_item_editor_templates is missing from userpermissions.sql
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Kyle M Hall
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 24606
Blocks: 34841
  Show dependency treegraph
 
Reported: 2023-09-20 12:31 UTC by Jonathan Druart
Modified: 2023-10-17 11:04 UTC (History)
2 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.11.00,23.05.04,22.11.11


Attachments
Bug 34844: Add manage_item_editor_templates to userpermissions.sql (2.34 KB, patch)
2023-09-20 13:51 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 34844: Add manage_item_editor_templates to userpermissions.sql (2.42 KB, patch)
2023-09-20 14:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34844: Add db update file (1.03 KB, patch)
2023-09-21 12:56 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 34844: Add db update file (1.12 KB, patch)
2023-09-21 12:57 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 34844: Add db update file (1.13 KB, patch)
2023-09-21 12:58 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 34844: Add manage_item_editor_templates to userpermissions.sql (2.42 KB, patch)
2023-09-22 08:05 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34844: Add db update file (1.27 KB, patch)
2023-09-22 08:05 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34844: Add manage_item_editor_templates to userpermissions.sql (2.51 KB, patch)
2023-09-22 09:19 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 34844: Add db update file (1.36 KB, patch)
2023-09-22 09:19 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 2023-09-20 12:31:11 UTC
Caught by 34841

To recreate

root@kohadevbox:koha$ perl /kohadevbox/misc4dev/run_tests.pl --run-db-upgrade-only

kohadev-koha@kohadevbox:koha$ prove t/Koha/Auth/Permissions.t
t/Koha/Auth/Permissions.t .. 1/3 
    #   Failed test 'Expected permissions generated for superlibrarian'
    #   at t/Koha/Auth/Permissions.t line 285.
    #     Structures begin differing at:
    #          $got->{CAN_user_editcatalogue_manage_item_editor_templates} = '1'
    #     $expected->{CAN_user_editcatalogue_manage_item_editor_templates} = Does not exist
    # Looks like you failed 1 test of 1.

#   Failed test 'superlibrarian tests'
#   at t/Koha/Auth/Permissions.t line 286.
# Looks like you failed 1 test of 3.

Please fix ASAP.
Comment 1 Kyle M Hall 2023-09-20 13:51:17 UTC
Created attachment 155931 [details] [review]
Bug 34844: Add manage_item_editor_templates to userpermissions.sql

Test Plan:
1) perl /kohadevbox/misc4dev/run_tests.pl --run-db-upgrade-only; prove t/Koha/Auth/Permissions.t
2) Note failure
3) Apply this patch
4) perl /kohadevbox/misc4dev/run_tests.pl --run-db-upgrade-only; prove t/Koha/Auth/Permissions.t
5) Tests pass!
Comment 2 Jonathan Druart 2023-09-20 14:10:53 UTC
Thanks, Kyle!
Comment 3 Jonathan Druart 2023-09-20 14:11:24 UTC
Created attachment 155933 [details] [review]
Bug 34844: Add manage_item_editor_templates to userpermissions.sql

Test Plan:
1) perl /kohadevbox/misc4dev/run_tests.pl --run-db-upgrade-only; prove t/Koha/Auth/Permissions.t
2) Note failure
3) Apply this patch
4) perl /kohadevbox/misc4dev/run_tests.pl --run-db-upgrade-only; prove t/Koha/Auth/Permissions.t
5) Tests pass!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Jonathan Druart 2023-09-21 12:08:45 UTC
We are missing an atomic update.
Comment 5 Kyle M Hall 2023-09-21 12:56:08 UTC
Created attachment 155994 [details] [review]
Bug 34844: Add db update file
Comment 6 Kyle M Hall 2023-09-21 12:57:29 UTC
Created attachment 155995 [details] [review]
Bug 34844: Add db update file
Comment 7 Kyle M Hall 2023-09-21 12:58:15 UTC
Created attachment 155996 [details] [review]
Bug 34844: Add db update file
Comment 8 Marcel de Rooy 2023-09-22 07:50:04 UTC
 WARN   installer/data/mysql/atomicupdate/bug_34844.pl
   WARN   tidiness
                The file is less tidy than before (bad/messy lines before: 0, now: 5)

        * Proving /usr/share/koha/t/Koha/Auth/Permissions.t KO!

    #   Failed test 'Expected permissions generated for superlibrarian'
    #   at /usr/share/koha/t/Koha/Auth/Permissions.t line 286.
     #     Structures begin differing at:
    #          $got->{CAN_user_editcatalogue_manage_item_editor_templates} = Does not exist
    #     $expected->{CAN_user_editcatalogue_manage_item_editor_templates} = '1'
     # Looks like you failed 1 test of 1.
Comment 9 Jonathan Druart 2023-09-22 08:05:45 UTC
Created attachment 156034 [details] [review]
Bug 34844: Add manage_item_editor_templates to userpermissions.sql

Test Plan:
1) perl /kohadevbox/misc4dev/run_tests.pl --run-db-upgrade-only; prove t/Koha/Auth/Permissions.t
2) Note failure
3) Apply this patch
4) perl /kohadevbox/misc4dev/run_tests.pl --run-db-upgrade-only; prove t/Koha/Auth/Permissions.t
5) Tests pass!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Jonathan Druart 2023-09-22 08:05:48 UTC
Created attachment 156035 [details] [review]
Bug 34844: Add db update file

JD amended patch: tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Marcel de Rooy 2023-09-22 09:19:55 UTC
Created attachment 156045 [details] [review]
Bug 34844: Add manage_item_editor_templates to userpermissions.sql

Test Plan:
1) perl /kohadevbox/misc4dev/run_tests.pl --run-db-upgrade-only; prove t/Koha/Auth/Permissions.t
2) Note failure
3) Apply this patch
4) perl /kohadevbox/misc4dev/run_tests.pl --run-db-upgrade-only; prove t/Koha/Auth/Permissions.t
5) Tests pass!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 12 Marcel de Rooy 2023-09-22 09:19:58 UTC
Created attachment 156046 [details] [review]
Bug 34844: Add db update file

JD amended patch: tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 13 Tomás Cohen Arazi 2023-09-22 13:56:12 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 14 Fridolin Somers 2023-09-22 19:30:44 UTC
Small typo at end of atomic update :

+++ b/installer/data/mysql/atomicupdate/bug_34844.pl
...
+
+        say $out "Added new permission 'manage_item_editor_templates'";
+    },
+    }

Should be :

+};
Comment 15 Fridolin Somers 2023-09-22 19:34:27 UTC
Pushed to 23.05.x for 23.05.04
Comment 16 Jacob O'Mara 2023-10-17 11:04:47 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x