mirror of
https://github.com/joomla/joomla-cms.git
synced 2024-07-01 01:23:43 +00:00
[4.0] Fix Custom Administrator Menu using Presets. (#27800)
This commit is contained in:
parent
9d0b9f61eb
commit
4c81a1a915
|
@ -11,6 +11,7 @@ namespace Joomla\Component\Menus\Administrator\Controller;
|
|||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Application\ApplicationHelper;
|
||||
use Joomla\CMS\Filter\InputFilter;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\Controller\FormController;
|
||||
|
@ -141,9 +142,12 @@ class MenuController extends FormController
|
|||
// Import the preset selected
|
||||
if (isset($preset) && $data['client_id'] == 1)
|
||||
{
|
||||
// Menu Type has not been saved yet. Make sure items get the real menutype.
|
||||
$menutype = ApplicationHelper::stringURLSafe($data['menutype']);
|
||||
|
||||
try
|
||||
{
|
||||
MenusHelper::installPreset($preset, $data['menutype']);
|
||||
MenusHelper::installPreset($preset, $menutype);
|
||||
|
||||
$this->setMessage(Text::_('COM_MENUS_PRESET_IMPORT_SUCCESS'));
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ namespace Joomla\Component\Menus\Administrator\Helper;
|
|||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Application\ApplicationHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Filesystem\Folder;
|
||||
use Joomla\CMS\Helper\ContentHelper;
|
||||
|
@ -494,6 +495,11 @@ class MenusHelper extends ContentHelper
|
|||
|
||||
$item->alias = $menutype . '-' . $item->title;
|
||||
|
||||
// Temporarily set unicodeslugs if a menu item has an unicode alias
|
||||
$unicode = Factory::getConfig()->set('unicodeslugs', 1);
|
||||
$item->alias = ApplicationHelper::stringURLSafe($item->alias);
|
||||
Factory::getConfig()->set('unicodeslugs', $unicode);
|
||||
|
||||
if ($item->type == 'separator')
|
||||
{
|
||||
// Do not reuse a separator
|
||||
|
|
Loading…
Reference in New Issue
Block a user