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

[4.3] Replace Factory::getUser() by $this->getCurrentUser() in components models #38090

Merged

Conversation

joomdonation
Copy link
Contributor

Pull Request for Issue # .

Summary of Changes

With #37498 being merged into 4.2, we can now replace deprecated method Factory::getUser() in components model classes with new method $this->getCurrentUser()

Testing Instructions

  1. Use Joomla 4.2 nightly build
  2. Apply patch
  3. Access to random pages (frontend, backend), make sure nothing is broken.

Actual result BEFORE applying this Pull Request

Works, but uses deprecated methods.

Expected result AFTER applying this Pull Request

Works, without using deprecated methods.

@laoneo laoneo added the Maintainers Checked Used if the PR is conceptional useful label Jun 20, 2022
@laoneo
Copy link
Member

laoneo commented Jun 20, 2022

I'm wondering if we should fallback here to Factory::getUser instead of an empty user?

@joomdonation
Copy link
Contributor Author

Factory::getUser would be more safe, I think (I believe in site, administrator and api applications, the fallback is not needed). I just don't know how it is used in installation and console apps.

@laoneo
Copy link
Member

laoneo commented Jun 20, 2022

Do you want to do it here or a separate one?

@joomdonation
Copy link
Contributor Author

Better in the separate PR, please

@laoneo
Copy link
Member

laoneo commented Jun 20, 2022

Here we go #38106.

@joomla-bot
Copy link
Contributor

This pull requests has been automatically converted to the PSR-12 coding standard.

@laoneo
Copy link
Member

laoneo commented Jul 1, 2022

Would be good to postpone this for 4.3. What do you think @joomdonation?

@joomdonation
Copy link
Contributor Author

@laoneo Yes, no rush. Let's give maintainers more time to review to see if there is any flow with this change.

@laoneo laoneo changed the base branch from 4.2-dev to 4.3-dev July 3, 2022 13:36
@laoneo laoneo changed the title [4.2] Replace Factory::getUser() by $this->getCurrentUser() in components models [4.3] Replace Factory::getUser() by $this->getCurrentUser() in components models Jul 3, 2022
@laoneo laoneo removed the PR-4.2-dev label Jul 3, 2022
@jwaisner
Copy link
Member

jwaisner commented Jul 28, 2022

I have tested this item ✅ successfully on c19a04a

Tested good on frontend and backend pages in Joomla 4.3 dev

Drone is erroring out but looks like a timeout issue so I do not believe this related.


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

@RickR2H
Copy link
Member

RickR2H commented Jul 29, 2022

I have tested this item ✅ successfully on c19a04a


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

@RickR2H
Copy link
Member

RickR2H commented Jul 29, 2022

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jul 29, 2022
@laoneo laoneo merged commit 4eaafed into joomla:4.3-dev Aug 12, 2022
@laoneo
Copy link
Member

laoneo commented Aug 12, 2022

Thanks!

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Aug 12, 2022
@zero-24 zero-24 added this to the Joomla! 4.3.0 milestone Aug 13, 2022
@joomdonation joomdonation deleted the replace_getuser_in_components_models branch March 10, 2023 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintainers Checked Used if the PR is conceptional useful
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants