Skip to content

[6.0] [joomla/database] use createQuery#45056

Merged
Bodge-IT merged 25 commits intojoomla:6.0-devfrom
heelc29:5.3/dababase/createquery
Sep 25, 2025
Merged

[6.0] [joomla/database] use createQuery#45056
Bodge-IT merged 25 commits intojoomla:6.0-devfrom
heelc29:5.3/dababase/createquery

Conversation

@heelc29
Copy link
Contributor

@heelc29 heelc29 commented Mar 2, 2025

Redo of Pull Request #42344.

DRAFT: due temporary update of joomla-framework/database#325

It is recommended to merge after #45827 > MERGED

Summary of Changes

Replaced all fuction calls getQuery(true) with createQuery() but only in database related context.
Note: There is also a getQuery(true) functionality in Joomla\CMS\Uri\Uri that must remain untouched.

Testing Instructions

code review or check logs

Actual result BEFORE applying this Pull Request

Since joomla/database 2.2.0: The parameter $new is deprecated and will be removed in 4.0, use Joomla\Database\DatabaseDriver::createQuery() instead.

Expected result AFTER applying this Pull Request

No warnings for getQuery(true) from core files (still some in session framework)

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed
  • No documentation changes for manual.joomla.org needed

@heelc29 heelc29 marked this pull request as draft March 2, 2025 12:02
@heelc29 heelc29 force-pushed the 5.3/dababase/createquery branch from 4ffc3a8 to cb8c6f2 Compare March 2, 2025 15:52
@heelc29 heelc29 marked this pull request as ready for review March 2, 2025 17:28
@exlemor
Copy link

exlemor commented Mar 15, 2025

@heelc29 Sadly, I see hundreds of use Joomla\Database\DatabaseDriver::createQuery() instead. - [ROOT]/libraries/vendor/symfony/deprecation-contracts/function.php - Line 25 BEFORE or AFTER the Patch...

I did many different things in the backend such as copy an article, upload an extension, etc etc WITH and WITHOUT the Patch applied and I sifted through ~8mg of deprecated.php log with no foreseeable difference...

What am I doing wrong?

PHP 8.3.19, MariaDB 10.6.15, Joomla 5.3 ßeta 2

@laoneo
Copy link
Member

laoneo commented Mar 15, 2025

The problem is that getDatabase() returns a DatabaseInterface which doesn't have that function as it is only part of the DatabaseDriver class. So this pr would bind us to the concrete implementation.

@HLeithner
Copy link
Member

@heelc29 can you please add this function to the framework database interface for version 4 and rebase this pr on 6.0.

@heelc29
Copy link
Contributor Author

heelc29 commented Mar 15, 2025

@heelc29 Sadly, I see hundreds of use Joomla\Database\DatabaseDriver::createQuery() instead. - [ROOT]/libraries/vendor/symfony/deprecation-contracts/function.php - Line 25 BEFORE or AFTER the Patch...

I did many different things in the backend such as copy an article, upload an extension, etc etc WITH and WITHOUT the Patch applied and I sifted through ~8mg of deprecated.php log with no foreseeable difference...

What am I doing wrong?

It is also used for example in joomla framework session so this tries to replace that one caused directly from the cms

Yes the deprecated.php log grows quickly

@heelc29
Copy link
Contributor Author

heelc29 commented Mar 15, 2025

@heelc29 can you please add this function to the framework database interface for version 4 and rebase this pr on 6.0.

Sure

@heelc29 heelc29 changed the base branch from 5.3-dev to 6.0-dev March 15, 2025 14:32
@heelc29 heelc29 requested review from Hackwar and laoneo as code owners March 15, 2025 14:32
@heelc29 heelc29 changed the title [5.3][joomla/database] use createQuery [6.0][joomla/database] use createQuery Mar 15, 2025
@heelc29 heelc29 marked this pull request as draft March 15, 2025 14:32
@rdeutz rdeutz marked this pull request as ready for review June 25, 2025 16:17
@exlemor
Copy link

exlemor commented Aug 16, 2025

I have tested this item ✅ successfully on 8ee8eeb

I have tested this successfully. Thx @heelc29.


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

@bembelimen bembelimen added the bug label Aug 20, 2025
@HLeithner HLeithner changed the title [6.0][joomla/database] use createQuery [6.0] [joomla/database] use createQuery Aug 31, 2025
@heelc29
Copy link
Contributor Author

heelc29 commented Sep 23, 2025

Conflicts resolved.

@Bodge-IT @softforge I think its to late for 6.0.0? Should I rebase to 6.1-dev or is it possible in a patch release?

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
@joomdonation
Copy link
Contributor

I have tested this item ✅ successfully on 45f9bea


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

@joomdonation
Copy link
Contributor

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Sep 25, 2025
@Bodge-IT Bodge-IT merged commit 508ac3d into joomla:6.0-dev Sep 25, 2025
57 of 58 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Sep 25, 2025
@Bodge-IT
Copy link
Contributor

Congrats @heelc29, thank you for the PR. Thanks to all involved for reviews, tests, guidance and comments.

@Bodge-IT Bodge-IT added this to the Joomla! 6.0.0 milestone Sep 25, 2025
@heelc29 heelc29 deleted the 5.3/dababase/createquery branch November 1, 2025 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

Comments