You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the function setUserState is not a available in the ConsoleApplication, although it is called in the function getUserStateFromRequest. I'm aware that the Console does not have a real user. But it seems that this sinkhole is missing?
Running an update would be as simple as calling Joomla\Component\Installer\Administrator\Model\UpdateModel->update(update id), however this fails since the Model uses setUserState.
As a workaround I could boot the AdministratorApplication from the Console command and use thatt application to run the UpdateModel or would it be better to 'copy' the UpdateModel and remove all the calls of setUserState? Which is annoying since they are in a private function.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I noticed that the function setUserState is not a available in the ConsoleApplication, although it is called in the function getUserStateFromRequest. I'm aware that the Console does not have a real user. But it seems that this sinkhole is missing?
I'm trying to build a plugin to run unattended updates. ( in case someone is interested).
Running an update would be as simple as calling Joomla\Component\Installer\Administrator\Model\UpdateModel->update(update id), however this fails since the Model uses setUserState.
As a workaround I could boot the AdministratorApplication from the Console command and use thatt application to run the UpdateModel or would it be better to 'copy' the UpdateModel and remove all the calls of setUserState? Which is annoying since they are in a private function.
Beta Was this translation helpful? Give feedback.
All reactions