joomla-extensions / jedchecker

Joomla extension to check components, modules or plugins for possible problems for submission to the JED -> Translations: https://joomla.crowdin.com/joomla-official-extensions
38 stars 28 forks source link

Factory::getUser has been removed from Joomla 5 #229

Closed dryabov closed 10 months ago

dryabov commented 10 months ago

see https://manual.joomla.org/migrations/44-50/

peterhulst commented 9 months ago

Hello,

It it possible to give a hint in the JED Checker e.g. $user = Factory::getUser() --> $user = $this->getCurrentUser()

Regards, Peter

dryabov commented 9 months ago

Not all classes have the getCurrentUser() method, and in other cases something like Factory::getApplication()->getIdentity() should be used instead. So, it depends on the context, and JEDChecker is unable to provide the best solution.

peterhulst commented 9 months ago

Thank you! Indeed: Factory::getApplication()->getIdentity() is in my case the right solution.