Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPD deprecated getQuery(true) #311

Open
wants to merge 1 commit into
base: 3.x-dev
Choose a base branch
from

Conversation

tkuschel
Copy link

@tkuschel tkuschel commented Sep 8, 2024

I am currently in the process of replacing the obsolete function getQuery(true) with createQuery() in Joomla CMS, see joomla/joomla-cms#42344 (work in progress, at the meantime it is a closed PR, but open again after testing here).
To make my life easier, I have added the interface to the database with the createQuery() on the one hand, on the other hand you can use a little trick to build in a backtrace in the output via trigger_deprecated(), so that with the help (I use code OSS under Linux Arch) of the debugger (DEBUG CONSOLE) you can immediately jump to the calling file. See attached screenshot.
Screenshot from 2024-09-08 09-22-00

The former deprecated message was also very unclear and I have reworded it.
Perhaps other deprecated messages can also be modified accordingly?

Summary of Changes

  1. Rewording of debug message for deprecation of getQuery() with $new parameter.
  2. Add the function createQuery() to the DatabaseInterface, also comment the deprecation there.

Testing Instructions

Debug messages at the DEBUG CONSOLE or log file for Deprecated API in Joomla CMS.

Documentation Changes Required

I don't know if this is not already sufficiently documented.

@HLeithner
Copy link
Contributor

Changing the Interface can't be done in 3.x, also the call to $this->getQuery(true); can't be changed here because it would also be a b/c break.

So this has to be moved to 4.0

@tkuschel
Copy link
Author

tkuschel commented Sep 8, 2024

Can we add the printing backtrace file only? - for 3.x -- this is a great help when debugging

@HLeithner
Copy link
Contributor

Not sure if this is a great idea, mainly for performance reasons, getting the stacktrace for each query call in production doesn't sounds great for me.

@tkuschel
Copy link
Author

tkuschel commented Sep 8, 2024

You are right performance decreases, when dealing with that, I can manually include that code during the replacements in my code.
I'll keep that PR as reminder, you may close.

@HLeithner
Copy link
Contributor

I keep this open and added it to the next framework maintainers meeting.

@HLeithner
Copy link
Contributor

Move Interface change to 4.0 and don't change the deprecation message using backtrace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants