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

Check if the identity is available when injecting into the local adapter #43588

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

laoneo
Copy link
Member

@laoneo laoneo commented Jun 1, 2024

Summary of Changes

When the local adapter is loaded through a console application it crashes.

Testing Instructions

Add the following line to the file /plugins/task/sessiongc/src/Extension/SessionGC.php inside the sessionGC function after line number 104:
$this->getApplication()->bootComponent('media')->getMVCFactory()->createmodel('Media', 'Administrator')->getProviders();

Then run the following commend in the console:
php cli/joomla.php scheduler:run -i 2

If the session GC task has a different id than 2, adapt the command accordingly.

Actual result BEFORE applying this Pull Request

The command fails with the current message:
Joomla\Plugin\Filesystem\Local\Adapter\LocalAdapter::setCurrentUser(): Argument #1 ($currentUser) must be of type Joomla\CMS\User\User, null given, called in /plugins/filesystem/local/src/Extension/Local.php on line 138

Expected result AFTER applying this Pull Request

Task runs trough.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@hytsch
Copy link

hytsch commented Jun 11, 2024

Fine, testet, it works on our live site.

@hytsch
Copy link

hytsch commented Jun 11, 2024

I have tested this item ✅ successfully on 0235bdf


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

@brianteeman
Copy link
Contributor

sorry I can't test it as I cannot replicate the reported error

image

@laoneo
Copy link
Member Author

laoneo commented Jun 11, 2024

Did you add the mentioned line from the test instructions? If yes, can you add a print_r of the result from the new code?

@brianteeman
Copy link
Contributor

Did you add the mentioned line from the test instructions? If yes, can you add a print_r of the result from the new code?

No I did not as I assumed that the error was always present. Sorry if that was my misunderstanding.

@brianteeman
Copy link
Contributor

I have tested this item ✅ successfully on 0235bdf

tested successfully according to instructions.


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

@Fedik
Copy link
Member

Fedik commented Jun 11, 2024

r2c


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jun 11, 2024
@wilsonge wilsonge merged commit 1cf918f into joomla:5.1-dev Jun 11, 2024
4 checks passed
@wilsonge
Copy link
Contributor

Thanks!

@wilsonge wilsonge deleted the local/identity branch June 11, 2024 10:58
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jun 11, 2024
@wilsonge wilsonge added this to the Joomla! 5.1.2 milestone Jun 11, 2024
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.

None yet

6 participants