diff --git a/components/com_content/src/Controller/ArticleController.php b/components/com_content/src/Controller/ArticleController.php index 950f9b71a5a7c..a8368f92955a0 100644 --- a/components/com_content/src/Controller/ArticleController.php +++ b/components/com_content/src/Controller/ArticleController.php @@ -289,9 +289,13 @@ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'a_id') $append .= '&' . $urlVar . '=' . $recordId; } - $itemId = $this->input->getInt('Itemid'); $return = $this->getReturnPage(); $catId = $this->input->getInt('catid'); + $itemId = $this->input->getInt('Itemid'); + + if (\in_array($this->getTask(), ['save2copy', 'apply'], true) && $this->input->exists('return_itemid')) { + $itemId = $this->input->getInt('return_itemid'); + } if ($itemId) { $append .= '&Itemid=' . $itemId; diff --git a/components/com_content/tmpl/form/edit.php b/components/com_content/tmpl/form/edit.php index 46d8935ed1a01..dcd217f2c9462 100644 --- a/components/com_content/tmpl/form/edit.php +++ b/components/com_content/tmpl/form/edit.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; +use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Multilanguage; use Joomla\CMS\Language\Text; @@ -34,6 +35,8 @@ if (!$params->exists('show_publishing_options')) { $params->set('show_urls_images_frontend', '0'); } + +$menu = Factory::getApplication()->getMenu()->getActive(); ?>