29
0
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:
infograf768 2020-02-04 21:59:27 +01:00 committed by GitHub
parent 9d0b9f61eb
commit 4c81a1a915
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -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'));
}

View File

@ -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