The SEBLOD system plugin which manages user guest init on load depending on multisite Yes/No seems to use method (Session) to set the SEBLOD Guest User that is not supported anymore in J4. In Fact, all components gets a user (the SEBLOD Site guest user) where they should have a guest.
The component views use $this->getCurrentUser() which returns a User object with a get('guest') method to check is user is guest.
In the SEBLOD system plugin, the JFactory::getUser() and Session->set() methods are used. JFactory;;getUser() is deprecated and the Session->set() seems to not do the job anymore to set the SEBLOD Site guest user.
Here's what we've done so far to fix the problem on a Multisite (and multilingual) J4.2.9/S4.0RP8 client website :
Add use lines
use Joomla\CMS\User\User; use Joomla\CMS\Factory;
And replacing lines where the user is set :
if ( ! $this->site ) {
//JFactory::getSession()->set( 'user', JFactory::getUser( $user->id ) );
Factory::getApplication()->loadIdentity( new User( $user->id ) );
return;
}
This seems to do the job and load the correct user for the whole session and components, like the com_users with the login form which was displaying the 'logout' button before the fix.
Hi,
The SEBLOD system plugin which manages user guest init on load depending on multisite Yes/No seems to use method (Session) to set the SEBLOD Guest User that is not supported anymore in J4. In Fact, all components gets a user (the SEBLOD Site guest user) where they should have a guest.
The component views use $this->getCurrentUser() which returns a User object with a get('guest') method to check is user is guest.
In the SEBLOD system plugin, the JFactory::getUser() and Session->set() methods are used. JFactory;;getUser() is deprecated and the Session->set() seems to not do the job anymore to set the SEBLOD Site guest user.
Here's what we've done so far to fix the problem on a Multisite (and multilingual) J4.2.9/S4.0RP8 client website :
Add use lines
use Joomla\CMS\User\User; use Joomla\CMS\Factory;
And replacing lines where the user is set :
This seems to do the job and load the correct user for the whole session and components, like the com_users with the login form which was displaying the 'logout' button before the fix.
Thx,
Olivier