? PR-5.0-dev Pending

User tests: Successful: 0 Unsuccessful: 0

avatar richard67
richard67
6 Aug 2022

Pull Request for Issue # .

Summary of Changes

This pull request (PR) removes the last code artefacts for using Joomla with Microsoft SQL Server / SQL Azure databases.

These database types are not supported anymore since Joomla 4.0, but there is the "SqlsrvChangeItem" class left in the "Joomla\CMS\Schema\ChangeItem" namespace, which is of no use in J4 and should be removed with 5.0.0.

For deprecation see PR #38428 .

This PR removes that class and corresponding code:

  • Remove file "SqlsrvChangeItem.php".
  • Remove alias for that file in "classmap.php".
  • Remove obsolete check for server type "mssql" in file "ChangeItem.php".

In addition, this PR removes an obsolete special handling for server type "mssql" in file "ChangeSet.php". The "sqlazure" subfolder doesn't exist anymore for core update SQL scripts since Joomla 4.0, and 3rd party extensions (which the database checker also checks since 4.0) are not expected to have any update SQL scripts for Microsoft SQL Server / SQL Azure.

All changes affect only the database checker ("System -> Maintenance -> Database", i.e. administrator/index.php?option=com_installer&view=database).

Additional information

The unit tests for the "Joomla\CMS\Schema\ChangeItem" namespace have never been migrated from Joomla 3 to Joomla 4, so in J4 we don't have any unit tests for the subject ot this PR.

I am preparing a PR to add unit tests for that namespace for the 4.2-dev branch (or maybe 4.3-dev), but that will still take some time until completed.

Testing Instructions

Code review, or make a new installation with the package built for this PR by drone and verify that the database checker works.

Actual result BEFORE applying this Pull Request

Obsolete code for Microsoft SQL Server / SQL Azure databases in the "Joomla\CMS\Schema\ChangeItem" namespace.

Expected result AFTER applying this Pull Request

No obsolete code for Microsoft SQL Server / SQL Azure databases in the "Joomla\CMS\Schema\ChangeItem" namespace.

The database checker works as well as without this PR.

Documentation Changes Required

None.

avatar richard67 richard67 - open - 6 Aug 2022
avatar richard67 richard67 - change - 6 Aug 2022
Status New Pending
avatar richard67 richard67 - change - 6 Aug 2022
The description was changed
avatar richard67 richard67 - edited - 6 Aug 2022
avatar joomla-cms-bot joomla-cms-bot - change - 6 Aug 2022
Category Libraries
avatar richard67 richard67 - change - 6 Aug 2022
The description was changed
avatar richard67 richard67 - edited - 6 Aug 2022
avatar Abernyte-Git
Abernyte-Git - comment - 6 Aug 2022

I have tested this item successfully on 96b73ca

Database checker works after patch applied.


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

avatar Abernyte-Git Abernyte-Git - test_item - 6 Aug 2022 - Tested successfully
avatar richard67 richard67 - change - 6 Aug 2022
The description was changed
avatar richard67 richard67 - edited - 6 Aug 2022
avatar richard67
richard67 - comment - 9 Aug 2022

LGTM but we'll need a deprecation tag on the class in the 4.x branch

@wilsonge I thought I had seen it there already, but you are right, it isn't. Will make a PR for that sooner or later.

avatar richard67
richard67 - comment - 9 Aug 2022

LGTM but we'll need a deprecation tag on the class in the 4.x branch

@wilsonge I thought I had seen it there already, but you are right, it isn't. Will make a PR for that sooner or later.

@wilsonge Do I have to do that for the 4.3-dev or for the 4.2-dev branch?

avatar richard67
richard67 - comment - 9 Aug 2022

Just clarified, will do it in 4.3-dev.

avatar richard67
richard67 - comment - 9 Aug 2022

For deprecation see #38428 .

avatar richard67 richard67 - change - 9 Aug 2022
The description was changed
avatar richard67 richard67 - edited - 9 Aug 2022
avatar brianteeman
brianteeman - comment - 9 Aug 2022

There are a few other places that refer to sqlserv that would be good to remove at the same time even if they are only comments

avatar richard67
richard67 - comment - 9 Aug 2022

There are a few other places that refer to sqlserv that would be good to remove at the same time even if they are only comments

@brianteeman Where? Could you point me to these? But if they are outside the schema namespace, I would do that with another PR.

Note that the database drivers still support to connect to MS SQL Server databases as external database. Only Joomla running on it is not supported anymore.

avatar brianteeman
brianteeman - comment - 9 Aug 2022

/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php#L1173

/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php#L1199

/administrator/components/com_menus/src/Model/ItemModel.php#L788

avatar richard67
richard67 - comment - 9 Aug 2022

@brianteeman /administrator/components/com_joomlaupdate/src/Model/UpdateModel.php#L1199 should be kept, otherwise the complete function would not make sense and should be removed. But we might keep the function for later use when we again remove support for some database type and need that to be checked before updating, and if we keep it we should keep the complete code so later readers can understand it.

avatar RickR2H
RickR2H - comment - 20 Oct 2022

I have tested this item successfully on 96b73ca

I used the package built for this PR to test. DB checker works.


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

avatar RickR2H RickR2H - test_item - 20 Oct 2022 - Tested successfully
avatar RickR2H RickR2H - change - 20 Oct 2022
Status Pending Ready to Commit
avatar RickR2H
RickR2H - comment - 20 Oct 2022

RTC


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

avatar HLeithner
HLeithner - comment - 21 Oct 2022

@richard67 can you please solve the conflicts please?

And maybe write the deprecation and removal documentation in manual? If not no problem I try to write it tomorrow.

avatar richard67 richard67 - change - 21 Oct 2022
Labels Added: ? PR-5.0-dev
avatar richard67
richard67 - comment - 21 Oct 2022

@HLeithner I've updated the branch and resolved the conflict. The failing appveyor is not related to this branch, it fails also in the 5.0-dev branch with the same error:

Error parsing appveyor.yml: (Line: 52, Col: 1, Idx: 1809) - (Line: 52, Col: 9, Idx: 1817): Duplicate key

Regarding deprecation docs: I don't know how to do that and won't learn that in the next days or weeks. So feel free to do that. But I do not see any need for any deprecations docs for the following reasons:

  • Before J4 the database schema checker only worked for the CMS core but not for 3rd party extensions.
  • Beginning with J4, including all pre-releases from 4.0.0-alpha1 on, the core does not support anymore to run on an MS SQL Server or MS Azure database.
  • Therefore it is impossible that the database schema checker ever has been used with such a database in J4, neither by the core nor by any 3rd party extension.
    So there is no need for any deprecation message. It absolutely makes no sense.
avatar richard67
richard67 - comment - 21 Oct 2022

P.S.: It seems also drone is broken in the 5.0-dev branch. It fails with some error related to certificates.

avatar HLeithner HLeithner - change - 23 Oct 2022
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-10-23 07:59:43
Closed_By HLeithner
avatar HLeithner HLeithner - close - 23 Oct 2022
avatar HLeithner HLeithner - merge - 23 Oct 2022
avatar HLeithner
HLeithner - comment - 23 Oct 2022

Thanks

Add a Comment

Login with GitHub to post a comment