I'm trying to do a "quick" fix to J3 components so they work in J4 until I can re-code in the new structure ready for J5. Now that I've set the scene, I'm stumbling on getting the Menu URL that was last selected before performing some updates to a record in the frontend.
Old J3 way I worked this in the controller was:
$menu = Factory::getApplication()->getMenu()->getActive(); $url = (empty($menu->link) ? 'index.php?option=com_mycomponent&view=multiviews' : $menu->link); $this->setRedirect(Route::_($url, false));
Now using this in an install of J4 keeps dumping me back to default home page. Any and all guidance appreciated. Glenn