J4 [RC] - Component keeps changing Menu Title

13 views
Skip to first unread message

Glenn Arkell

unread,
Jun 22, 2021, 11:20:38 PM6/22/21
to Joomla! General Development
Testing component in J4 and when I select a menu item that displays a listing of items, if I change the filter within the view, the refreshed screen displays the Home page title.  Is this a bug?

view.html.php

        $menu = Factory::getApplication()->getMenu()->getActive();
 
        if ($menu) {
            $this->params->def('page_heading', $this->params->get('page_title', $menu->title));
        } else {
            $this->params->def('page_heading', Text::_('COM_MYCOMPONENT_DEFAULT_PAGE_TITLE'));
        }

        $title = $this->params->get('page_title', '');

Glenn

Glenn Arkell

unread,
Jun 23, 2021, 12:17:52 AM6/23/21
to Joomla! General Development

Hannes Papenberg

unread,
Jun 23, 2021, 5:22:40 AM6/23/21
to joomla-de...@googlegroups.com
No, the github issue you cited has nothing to do with this. The problem
most likely is, that you are filtering your output, but your new request
to the server doesn't contain either the original URL or Itemid and thus
the router falls back to the homepage menu item. If you look at your
URL, you will see, that it is majorly different between your first call
and the filtered call.

Hannes
> --
> You received this message because you are subscribed to the Google
> Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to joomla-dev-gene...@googlegroups.com
> <mailto:joomla-dev-gene...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/joomla-dev-general/81717661-0e93-4638-970c-19bb922bf572n%40googlegroups.com
> <https://groups.google.com/d/msgid/joomla-dev-general/81717661-0e93-4638-970c-19bb922bf572n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Glenn Arkell

unread,
Jun 23, 2021, 5:43:10 AM6/23/21
to Joomla! General Development
Ahhh, thanks for the pointer Hannes.  Cheers.
Glenn
Reply all
Reply to author
Forward
0 new messages