54 Posts
nzimas
10 months ago
5
Topic

After updating to SELOD 4 on an already upgraded Joomla 4 installation (from Joomla 3), I am encountering he following error when trying to access an extended user profile edit view (routed from com_user to  SEBLOD).

0 - Cannot access protected property Joomla\CMS\Menu\MenuItem::$params

Call stack #FunctionLocation 1()JROOT/plugins/system/cck/cck.php:456 2plgSystemCCK->onAfterDispatch()JROOT/libraries/src/Plugin/CMSPlugin.php:279 3Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin\{closure}()JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:486 4Joomla\Event\Dispatcher->dispatch()JROOT/libraries/src/Application/EventAware.php:107 5Joomla\CMS\Application\WebApplication->triggerEvent()JROOT/libraries/src/Application/SiteApplication.php:213 6Joomla\CMS\Application\SiteApplication->dispatch()JROOT/libraries/src/Application/SiteApplication.php:249 7Joomla\CMS\Application\SiteApplication->doExecute()JROOT/libraries/src/Application/CMSApplication.php:294 8Joomla\CMS\Application\CMSApplication->execute()JROOT/includes/app.php:61 9require_once()JROOT/index.php:32

It doesn't seem to be template related because the error happens even when the default Joomla 4 template is chosen.


I made sure that several settings on the SEBLOD configuration panel are set to legacy mode, namely JS Bootstrap and SQL Mode.

Get a Book for SEBLOD
54 Posts
nzimas
10 months ago
0
Level 1

There is a compatibility issue in plugins/system/cck/cck.php, in line 456.

In Joomla 4, params is a protected property. To access it, you should use the getParams() method which will return an instance of the Registry class.

I have changed $urlvars = $item->params->get( 'urlvars' );

to

$urlvars = $item->getParams()->get('urlvars');

and now the extended user profile edit view loads correctly.

153 Posts
Hableur
10 months ago
2
Level 1

Hi, thanks for this post.

I have the same problem on an updated site (J3S3 to J4S4) but also on an new site J4S4.

I have applied your tip about plugins/system/cck/cck.php but I have new error, the same on the 2 sites :

Call to a member function get() on null

Call stack
# Function Location
1 () JROOT/plugins/system/cck/cck.php:456
2 plgSystemCCK->onAfterDispatch() JROOT/libraries/src/Plugin/CMSPlugin.php:284
3 Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin\{closure}() JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:486
4 Joomla\Event\Dispatcher->dispatch() JROOT/libraries/src/Application/EventAware.php:111
5 Joomla\CMS\Application\WebApplication->triggerEvent() JROOT/libraries/src/Application/SiteApplication.php:213
6 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:249
7 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:293
8 Joomla\CMS\Application\CMSApplication->execute() JROOT/includes/app.php:61
9 require_once() JROOT/index.php:32

So it seems urlvars doesn't exist. Perhaps a problem of configuration of user integration mode, but I don't find it.

54 Posts
nzimas
10 months ago
1
Level 2

Could be.

You may set legacy mode options on the general configuration tab of SEBLOD 4, which can be accessed via Joomla's Global Configuration.

153 Posts
Hableur
10 months ago
0
Level 3

Thanks.

I have tried but it dosesn't work. Same error : Call to a member function get() on null

153 Posts
Hableur
7 months ago
0
Level 1

Hello,

I find where is my problem.

You are right, it's necessary to replace $urlvars = $item->params->get( 'urlvars' ); to $urlvars = $item->getParams()->get('urlvars'); in plugins/system/cck/cck.php

But with that my problem is not resolved.

In fact, when user want to access is profil, the url has some errors like that :

https://mysite.fr/component/cck/form/user.html?id=(number)&_amp;Itemid=(number)&_amp;return=aHR...

If I replace &_amp; by & in the url, that works ! It's logical.
The problem is now : why &_amp instead of &, and where correcting that ?

Thanks for an idea :)

PS : there is no underscore in fact, but it's not possible to write &_amp; without underscore in this forum ;)

Get a Book for SEBLOD