Bug 17504 - Installer shows PostgreSQL info when wrong DB permissions
Summary: Installer shows PostgreSQL info when wrong DB permissions
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (web-based installer) (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-26 14:24 UTC by Tomás Cohen Arazi
Modified: 2016-11-08 10:32 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Screenshot (100.53 KB, image/png)
2016-10-26 14:24 UTC, Tomás Cohen Arazi
Details
Bug 17504: Make the installer show the right dmbs help if wrong permissions (2.89 KB, patch)
2016-10-26 14:41 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 17504: Make the installer show the right dmbs help if wrong permissions (2.94 KB, patch)
2016-10-28 20:18 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17504: Make the installer show the right dmbs help if wrong permissions (3.00 KB, patch)
2016-10-31 12:56 UTC, Jonathan Druart
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 2016-10-26 14:24:46 UTC
Created attachment 56873 [details]
Screenshot

Steps to reproduce:
- Make sure the DB user doesn't have all required privileges
- Delete then create the DB
- Run the installer
=> FAIL: PostgreSQL information shown (as in the attachment)
Comment 1 Tomás Cohen Arazi 2016-10-26 14:41:48 UTC
Created attachment 56875 [details] [review]
Bug 17504: Make the installer show the right dmbs help if wrong permissions

This patch changes the installer template for step 2 (DB rights check)
so it correctly displays MySQL-related message.
The previous code was doing the wrong comparisson, thus yielding
PostgreSQL documentation.

To test:
- Run:
  $ sudo koha-mysql kohadev
  > DROP DATABASE koha_kohadev ; CREATE DATABASE koha_kohadev;
  > REVOKE INSERT ON koha_kohadev.* FROM 'koha_kohadev'@'localhost';
  > FLUSH PRIVILEGES; \q
- Run the webinstaller through step 2
=> FAIL: You get the message in the attached screenshot
- Apply the patch, reload
=> SUCCESS: You are displayed a different warning message, with a link
to up-to-date MySQL docs on GRANT
- Fix permissions for the user:
  $ sudo koha-mysql kohadev
  > GRANT ALL PRIVILEGES on koha_kohadev.* TO 'koha_kohadev'@'localhost';
  > FLUSH PRIVILEGES; \q
- Reload
=> SUCCESS: All checks are correct and you can move on
- Sign off :-D
Comment 2 Josef Moravec 2016-10-28 20:18:14 UTC
Created attachment 56968 [details] [review]
Bug 17504: Make the installer show the right dmbs help if wrong permissions

This patch changes the installer template for step 2 (DB rights check)
so it correctly displays MySQL-related message.
The previous code was doing the wrong comparisson, thus yielding
PostgreSQL documentation.

To test:
- Run:
  $ sudo koha-mysql kohadev
  > DROP DATABASE koha_kohadev ; CREATE DATABASE koha_kohadev;
  > REVOKE INSERT ON koha_kohadev.* FROM 'koha_kohadev'@'localhost';
  > FLUSH PRIVILEGES; \q
- Run the webinstaller through step 2
=> FAIL: You get the message in the attached screenshot
- Apply the patch, reload
=> SUCCESS: You are displayed a different warning message, with a link
to up-to-date MySQL docs on GRANT
- Fix permissions for the user:
  $ sudo koha-mysql kohadev
  > GRANT ALL PRIVILEGES on koha_kohadev.* TO 'koha_kohadev'@'localhost';
  > FLUSH PRIVILEGES; \q
- Reload
=> SUCCESS: All checks are correct and you can move on
- Sign off :-D

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 3 Jonathan Druart 2016-10-31 12:56:10 UTC
Created attachment 56996 [details] [review]
Bug 17504: Make the installer show the right dmbs help if wrong permissions

This patch changes the installer template for step 2 (DB rights check)
so it correctly displays MySQL-related message.
The previous code was doing the wrong comparisson, thus yielding
PostgreSQL documentation.

To test:
- Run:
  $ sudo koha-mysql kohadev
  > DROP DATABASE koha_kohadev ; CREATE DATABASE koha_kohadev;
  > REVOKE INSERT ON koha_kohadev.* FROM 'koha_kohadev'@'localhost';
  > FLUSH PRIVILEGES; \q
- Run the webinstaller through step 2
=> FAIL: You get the message in the attached screenshot
- Apply the patch, reload
=> SUCCESS: You are displayed a different warning message, with a link
to up-to-date MySQL docs on GRANT
- Fix permissions for the user:
  $ sudo koha-mysql kohadev
  > GRANT ALL PRIVILEGES on koha_kohadev.* TO 'koha_kohadev'@'localhost';
  > FLUSH PRIVILEGES; \q
- Reload
=> SUCCESS: All checks are correct and you can move on
- Sign off :-D

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 4 Kyle M Hall 2016-11-02 10:58:58 UTC
Pushed to master for 16.11, thanks Jonathan!
Comment 5 Frédéric Demians 2016-11-02 18:38:21 UTC
Pushed in 16.05. Will be in 16.05.06.
Comment 6 Julian Maurice 2016-11-08 10:32:05 UTC
Pushed to 3.22.x, will be in 3.22.13