User tests: Successful: Unsuccessful:
Pull Request for Issue # .
Removes deprecated code from Joomla\CMS\Menu\MenuItem
.
Install sample data or create some menu items.
Navigate frontend and backend.
Inspect menu items.
Works like before.
Some methods removed.
Added Joomla\CMS\Menu\AdministratorMenuItem
class.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_menus Modules Front End com_contact com_content com_newsfeeds com_tags Libraries Plugins Templates (site) |
Labels |
Added:
?
|
On which page are you getting this?
On which page are you getting this?
I was testing this on cloudaccess. And applied the patch. Once applied site became black.
Do you have any 3rd party extensions installed? Maybe using Cloudbase template?
Do you have any 3rd party extensions installed? Maybe using Cloudbase template?
No pure joomla 4 nightly build
Category | Administration com_menus Modules Front End com_contact com_content com_newsfeeds com_tags Libraries Plugins Templates (site) | ⇒ | Administration com_menus Modules Front End com_contact com_content com_newsfeeds com_tags com_users Libraries Plugins Templates (site) |
Title |
|
Should work now but don't test yet. Performance could be bad at the moment.
Title |
|
OK, this can be tested now.
Go to Components Dashboard.
Notice: Undefined property: Joomla\CMS\Menu\MenuItem::$permission in \administrator\modules\mod_submenu\Menu\Menu.php on line 56
Notice: Undefined property: Joomla\CMS\Menu\MenuItem::$icon in \administrator\modules\mod_submenu\tmpl\default.php on line 22
Go to Components Dashboard:
Notice: Undefined property: Joomla\CMS\Menu\MenuItem::$icon in \administrator\modules\mod_submenu\tmpl\default.php on line 22
I like these changes. However, the change from browserNav
to target
is a B/C break and needs to be properly documented.
No, it's not.
Though maybe there's a better way to do this. browserNav
is a numeric value from database. In some places in backend it's overwritten with the string used in markup. target
is only used in backend and it also holds same string. Do we need both of these properties? Maybe remove target
and use only browserNav
?
In frontend it's much simpler. Only browserNav
is used and it does not get overwritten.
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
|
Though maybe there's a better way to do this. browserNav is a numeric value from database. In some places in backend it's overwritten with the string used in markup. target is only used in backend and it also holds same string. Do we need both of these properties? Maybe remove target and use only browserNav?
If that works - and they are exactly the same thing (struggling to tell from a quick code review - I'd probably go down that route. Maybe revert the rename here https://github.com/joomla/joomla-cms/pull/26537/files#diff-1b5557519e9638a5bde91cf3432456dfR403 and then make that change in a separate PR?
I think it's best to subclass MenuItem
for administrator items and add missing properties there.
Category | Administration com_menus Modules Front End com_contact com_content com_newsfeeds com_tags Libraries Plugins Templates (site) com_users | ⇒ | Administration com_menus Modules Front End com_contact com_content com_newsfeeds com_tags com_users Libraries Plugins |
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-11-30 21:38:07 |
Closed_By | ⇒ | wilsonge |
Thanks!
I have this kind of call in my component :
$params = Factory::getApplication()->getMenu()->getActive()->params;
with this change it display : Cannot access protected property Joomla\CMS\Menu\MenuItem::$params
Can-i call instead $params = Factory::getApplication()->getMenu()->getActive()->getParams();
? getParams() isn't deprecated anymore ?
Yes, use getParams()
to access params.
Error: Cannot access protected property Joomla\CMS\Menu\MenuItem::$params: Cannot access protected property Joomla\CMS\Menu\MenuItem::$params
Are these changes due to a bug on the frontend?
@bugsmafia Are you using any 3rd party extensions?
@bugsmafia Are you using any 3rd party extensions?
no, clean joomla 4 dev.
Files were updated (developer build of December 16) (with full replacement) after 1 month of development (build of November 7, 2019).
On which pages does this error occur?
On which pages does this error occur?
Any articles, including the default Featured Articles page
(whether a problem occurs with other components is unknown)
/index.php?option=com_content&view=article&id=2&Itemid=103
Build on November 7th. on the links from the menu to any article gave an error 404.
after updating to the build on December 16th.
"Error: Cannot access protected property Joomla\CMS\Menu\MenuItem::$params: Cannot access protected property Joomla\CMS\Menu\MenuItem::$params"
I can't replicate this issue on current nightly (https://developer.joomla.org/nightly-builds.html) and on my git clone.
If you upload a zip of your installation (only files, no database), I could take a look.
I can't replicate this issue on current nightly (https://developer.joomla.org/nightly-builds.html) and on my git clone.
If you upload a zip of your installation (only files, no database), I could take a look.
write me bugsmafia@gmai.com or Telegram @bugsm
yep, update only file (full pack),
update structure DB does not fix the error
I Found the source of the problem in my template.
$pageclass = $menu->params->get('pageclass_sfx');
or
$pageclass = $menu->getParams()->get('pageclass_sfx');
I have tested this item? unsuccessfully on 9137ad0
Error: Cannot access protected property Joomla\CMS\Menu\MenuItem::$params: Cannot access protected property Joomla\CMS\Menu\MenuI
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26537.