Bug 21961: Fix typo in manage_didyoumean permission
authorKatrin Fischer <katrin.fischer.83@web.de>
Thu, 6 Dec 2018 11:42:12 +0000 (12:42 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 12 Dec 2018 10:57:09 +0000 (10:57 +0000)
The typo in the installer files will cause problems on new
installations as the code for the permission is wrong.

This means that on new installations the Did you mean? section
on the administration page won't show up.

In order to fix this, we need to correct the code in
permissions, but also the permissions for users who
this permission has been given to.

To test:
- Start without the patch
- Use a new installation with the permission typo
- Log in as superlibrarian
- Verify that the "did you mean?" configuration page
  is not visible
- Create another staff user with permission to access
  staff and manage_didyoumean checked
- Verify configuration page remains invisible
- Apply patch and run database update
- Check both users again, the config page should now sohw

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit da5e41f6def8a5cbafc9303b0fff35cb13e50e72)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

installer/data/mysql/atomicupdate/bug_21961_didyouean_typo.sql [new file with mode: 0644]
installer/data/mysql/userpermissions.sql

diff --git a/installer/data/mysql/atomicupdate/bug_21961_didyouean_typo.sql b/installer/data/mysql/atomicupdate/bug_21961_didyouean_typo.sql
new file mode 100644 (file)
index 0000000..a78f856
--- /dev/null
@@ -0,0 +1,4 @@
+UPDATE permissions SET code = "manage_didyoumean" WHERE code = "manage_didyouean";
+UPDATE user_permissions SET code = "manage_didyoumean" WHERE code = "manage_didyouean";
+
+-- Bug 21961 - Fix typo in manage_didyoumean permission
index cb71d77..ba1061e 100644 (file)
@@ -25,7 +25,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES
    ( 3, 'manage_item_search_fields', 'Manage item search fields'),
    ( 3, 'manage_search_engine_config', 'Manage search engine configuration'),
    ( 3, 'manage_search_targets', 'Manage Z39.50 and SRU server configuration'),
-   ( 3, 'manage_didyouean', 'Manage Did you mean? configuration'),
+   ( 3, 'manage_didyoumean', 'Manage Did you mean? configuration'),
    ( 3, 'manage_column_config', 'Manage column configuration'),
    ( 3, 'manage_sms_providers', 'Manage SMS cellular providers'),
    ( 3, 'manage_audio_alerts', 'Manage audio alerts'),