? ? Pending

User tests: Successful: Unsuccessful:

avatar Duke3D
Duke3D
8 Jun 2019

Pull Request for Issue # .
First report.

Summary of Changes

Added to validation of user-entered database prefix.

  1. user's response is converted to lowercase so that value stored in configuration.php is in alignment with the default behavior (convert to lowercase) of the MySQL database.
  2. test for and append underscore, if missing.

Testing Instructions

Run Installer.
A) At Database Prefix field, enter mixed or upper case prefix ending with underscore.
B) Repeat except enter mixed or upper case prefix without underscore.

Expected result

Installed database has lowercase prefix and value matches database prefix as stored in configuration.php.

Actual result

If not patched, installed database has lowercase prefix. Database prefix stored in configuration.php has mixed case prefix. Can lead to database issues on Linux servers and reference errors that appear on server migration.

Documentation Changes Required

None

avatar Duke3D Duke3D - open - 8 Jun 2019
avatar Duke3D Duke3D - change - 8 Jun 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 Jun 2019
Category Installation
avatar infograf768
infograf768 - comment - 9 Jun 2019

This deals only for the session prefix. It should also deal with new prefix when modified, therefore out of the if/else.
Also cs is bad.

avatar franz-wohlkoenig franz-wohlkoenig - change - 9 Jun 2019
Title
Update PrefixField.php in Installer
[4.0] Update PrefixField.php in Installer
avatar franz-wohlkoenig franz-wohlkoenig - edited - 9 Jun 2019
avatar brianteeman
brianteeman - comment - 9 Jun 2019

To satisfy the codestyle requirements please address the following issues

FILE: /********/src/installation/src/Form/Field/Installation/PrefixField.php
--
46 | --------------------------------------------------------------------------------
47 | FOUND 4 ERROR(S) AFFECTING 3 LINE(S)
48 | --------------------------------------------------------------------------------
49 | 82 \| ERROR \| Please consider a blank line preceding your comment
50 | 85 \| ERROR \| Please consider a blank line preceding your comment
51 | 86 \| ERROR \| Expected "if (...)\n"; found "if (...) "
52 | 86 \| ERROR \| Closing brace must be on a line by itself


avatar Duke3D Duke3D - change - 16 Jun 2019
Labels Added: ?
avatar Quy
Quy - comment - 21 Jun 2019

@Duke3D Please do as requested here: #25144 (comment)

avatar Schmidie64 Schmidie64 - test_item - 19 Oct 2019 - Tested unsuccessfully
avatar Schmidie64
Schmidie64 - comment - 19 Oct 2019

I have tested this item ? unsuccessfully on 0e7b5ca

After applying the patch, the prefix in the database is in lower case (without the patch it's also in lower case). In the configuration.php is the prefix still in mixed cases. So the pr doesen't work well.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25144.

avatar richard67
richard67 - comment - 1 Jun 2020

To fix #25144 (comment) , the checks have to be added to 2 places:

(Or maybe just the regex needs to be modified).

If my PR #29362 will be ready and merged, it will be only one place where to change that.

But I am in doubt if this PR here is right, because we had such check already for PostgreSQL, where it seems to matter, e.g. here:
https://github.com/joomla/joomla-cms/blob/4.0-dev/installation/src/Model/DatabaseModel.php#L133

So I think it could have had a reason why we only did it for PostgreSQL and not for MySQL.

But who knows, maybe it was wrong all the time for MySQL.

avatar roland-d
roland-d - comment - 1 Aug 2020

@Duke3D Any interest in picking this up or should the PR be closed?

avatar Quy
Quy - comment - 5 Sep 2020

Closing due to no response.

avatar Quy Quy - change - 5 Sep 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-09-05 21:52:12
Closed_By Quy
Labels Added: ?
avatar Quy Quy - close - 5 Sep 2020

Add a Comment

Login with GitHub to post a comment