? ? Success

User tests: Successful: Unsuccessful:

avatar Skrol29
Skrol29
4 Sep 2020

Pull Request for Issue # .

Summary of Changes

The installation of Joomla in a PostgreSQL database is nowadays limited to the schema named "public".
This limitation is the due to only one line of code in the PostgreSQL (PDO) driver : this is in the function getTableColumns()
where a search for columns is made explicitly in the "public" schema.

The changes of this Pull Request make the function getTableColumns() to search columns in the default schema of the connection instead of the "public" schema.
This goes with a new private function named getDefaultSchema(), which could be used for future coding when we need to now the default schema in PostgreSQL.

The ability to install Joomla in a dedicated schema is more comfortable, opened, et secured.

Testing Instructions

Create a PostgreSQL schema dedicated to your Joomla application.
Also create a user dedicated for your Joomla application connection.

SQL instruction :

-- create a schema dedicated to your Joomla application
CREATE SCHEMA schema_joomla_app;

-- create a user dedicated to your Joomla application connection
CREATE ROLE user_joomla_app WITH
  LOGIN
  NOSUPERUSER
  INHERIT
  NOCREATEDB
  NOCREATEROLE
  REPLICATION
  ENCRYPTED PASSWORD 'xxxxxxxx';

-- limit the user permissions to the dedicated schema
GRANT ALL ON SCHEMA schema_joomla_app TO user_joomla_app WITH GRANT OPTION;

-- set the default schema for the user
ALTER ROLE user_joomla_app IN DATABASE my_test_db SET search_path TO schema_joomla_app;
  1. Start a fresh new Joomla installation, at the Database configuration step, choose the Database type : "PostgreSQL (PDO)", and continue the installation process using your user and database connection.

Actual result BEFORE applying this Pull Request

At the last step of the installation, the process never ends (test on Joomla 3.9.21) because a silent error as occurred: one Ajax response hold the error message : "No columns found for #__extensions table".

In the database, all Joomla tables seems to be correctly created.

If you restart the installation from the previous step, the the same error occurs.

Expected result AFTER applying this Pull Request

The installation ends without error.
Joomla is functional.

Documentation Changes Required

No

avatar Skrol29 Skrol29 - open - 4 Sep 2020
avatar Skrol29 Skrol29 - change - 4 Sep 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 4 Sep 2020
Category Libraries
avatar Skrol29 Skrol29 - change - 17 Sep 2020
Labels Added: ?
avatar richard67
richard67 - comment - 18 Sep 2020

@wilsonge Should this be fixed upstream in the framework package, too?

avatar Skrol29
Skrol29 - comment - 18 Sep 2020

@wilsonge Should this be fixed upstream in the framework package, too?

Yes, but I cannot test it yet.
The code is nearly the same in https://github.com/joomla-framework/database/blob/master/src/Pgsql/PgsqlDriver.php

avatar richard67
richard67 - comment - 19 Sep 2020

@Skrol29 Your PR here changes the PDO driver for PostgreSQL. But on 3.9.x we still have to support the native PostgreSQL driver, too.

Could you do the same changes in file https://github.com/Skrol29/fork-joomla-cms/blob/pgsql-support/libraries/joomla/database/driver/postgresql.php ?

Just edit that file in the branch of this PR and commit the changes so that change will be part of this PR here, too.

Let me know if you need advise with that.

Update 2020-10-12 by @richard67 : Has been solved meanwhile, see commit below.

After this PR will be tested with success and finally be merged into the staging branch here, I will take care of bringing up the change to the upstream repository in the framework and to bring it into the 2.0 branch of the framework database package so the correction will at the end also arrive in Joomla 4.

avatar alikon
alikon - comment - 20 Sep 2020

i've made a test on PDO and it works

@Skrol29
so i've made a PR to you branch for Postgresql Skrol29#1

avatar joomla-cms-bot joomla-cms-bot - change - 20 Sep 2020
Category Libraries Libraries Postgresql
avatar Skrol29
Skrol29 - comment - 21 Sep 2020

The continuous-integration/drone/pr has failed on the Codequality / Javascript test. This seems mis relevant. Can somebody help on this or restart the check ?

avatar richard67
richard67 - comment - 21 Sep 2020

Restarted the check, maybe we are more lucky this time.

avatar alikon alikon - test_item - 24 Sep 2020 - Tested successfully
avatar alikon
alikon - comment - 24 Sep 2020

I have tested this item successfully on 40a5784


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

avatar Skrol29
Skrol29 - comment - 12 Oct 2020

Can someone else with permissions add a Human Test ? So the Pull Request could goes one...

avatar richard67
richard67 - comment - 13 Oct 2020

@alikon Regarding your previous test: Have you tested only the PDO driver, or both PDO and the native PostgreSQL driver? And have you also tested if it works like before when not using a different default scheme but the public scheme, i.e. the usual way?

avatar N6REJ
N6REJ - comment - 2 Nov 2020

@Skrol29 please correct the conflicts

avatar richard67
richard67 - comment - 3 Nov 2020

@Skrol29 It seems with resolving the conflict you have removed the definition of function getDefaultSchema from file libraries/joomla/database/driver/postgresql.php.

avatar Skrol29
Skrol29 - comment - 20 Nov 2020

What is the next step for a RTC (Ready To Commit) ? Does it need a second approval ?
If the Pull Request is accepted, do I need another one for Joomla 4 ?

avatar richard67
richard67 - comment - 20 Nov 2020

What is the next step for a RTC (Ready To Commit) ? Does it need a second approval ?

No, but it needs a second two human tests.

If the Pull Request is accepted, do I need another one for Joomla 4 ?

No, when it has been merged into the staging branch, it will sooner or later arrive in the 3.10-dev branch, too. For 4.0-dev it would need to make a pull request for the 2.0-dev branch of the database package in the framework here: https://github.com/joomla-framework/database.

avatar richard67
richard67 - comment - 20 Nov 2020

P.S.: @alikon Could you test again, if possible with both the native PostgreSQL driver and the PDO driver? Thanks in advance.

avatar alikon alikon - test_item - 22 Nov 2020 - Tested successfully
avatar alikon
alikon - comment - 22 Nov 2020

I have tested this item successfully on b6fc438

i've tested both with pdo/postgresql with public/default schema and works as before
i've tested both with pdo/postgresql with dedicated schema and works
postgresql 11.7


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

avatar gostn gostn - test_item - 24 Nov 2020 - Tested successfully
avatar gostn
gostn - comment - 24 Nov 2020

I have tested this item successfully on b6fc438


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

avatar richard67 richard67 - change - 24 Nov 2020
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 24 Nov 2020

RTC


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

avatar richard67
richard67 - comment - 24 Nov 2020

@wilsonge I will care for porting this up to the framework (master and 2.0-dev).

avatar richard67
richard67 - comment - 24 Nov 2020

@wilsonge PR for the framework is joomla-framework/database#217 .

avatar richard67 richard67 - change - 26 Nov 2020
Labels Added: ?
avatar richard67 richard67 - alter_testresult - 4 Dec 2020 - alikon: Tested successfully
avatar richard67 richard67 - alter_testresult - 4 Dec 2020 - gostn: Tested successfully
avatar richard67
richard67 - comment - 4 Dec 2020

Previous tests and RTC status are still valid. Last 2 commits by me only corrected 2 code comments. I've restored the test results so they are properly counted.

avatar wilsonge wilsonge - change - 14 Dec 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-12-14 18:39:34
Closed_By wilsonge
avatar wilsonge wilsonge - close - 14 Dec 2020
avatar wilsonge wilsonge - merge - 14 Dec 2020
avatar wilsonge
wilsonge - comment - 14 Dec 2020

Thankyou @Skrol29 !

avatar Skrol29
Skrol29 - comment - 14 Dec 2020

Thankyou @Skrol29 !

Thanks to all of you :-)

Add a Comment

Login with GitHub to post a comment