Skip to content

Commit

Permalink
[K6.2] Set Aurelia as default in config when migrate from K5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
xillibit committed Oct 3, 2023
1 parent 79baa0e commit a9b5d2d
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/admin/install/kunena.install.upgrade.xml
Expand Up @@ -58,7 +58,12 @@
<version version="5.2.15-DEV"
versiondate="2021-07-24"
versionname="Internal">
<phpfile name="5.2.15-2021-07-24_configuration"/>
<phpfile name="5.2.15-2021-07-24_update_configuration"/>
</version>
<version version="5.2.15-DEV"
versiondate="2021-08-24"
versionname="Internal">
<phpfile name="5.2.15-2021-08-24_configuration_default_template"/>
</version>
<version version="6.0.0-BETA3-DEV"
versiondate="2021-09-13"
Expand Down
Expand Up @@ -21,7 +21,7 @@
* @throws Exception
* @since Kunena 5.2.4
*/
function kunena_5215_2021_07_24_configuration($parent) {
function kunena_5215_2021_07_24_update_configuration($parent) {
$config = KunenaFactory::getConfig();

$config->boardTitle = $config->board_title;
Expand Down
@@ -0,0 +1,41 @@
<?php

/**
* Kunena Component
*
* @package Kunena.Installer
*
* @copyright Copyright (C) 2008 - 2023 Kunena Team. All rights reserved.
* @license https://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link https://www.kunena.org
**/

defined('_JEXEC') or die();

use Joomla\CMS\Language\Text;
use Kunena\Forum\Libraries\Factory\KunenaFactory;

// Kunena 6.0.0: Set Aurelia as default template in config when update
/**
* @param string $parent parent
*
* @return array
*
* @throws Exception
* @since Kunena 6.0
*/
function kunena_5215_2021_08_24_configuration_default_template($parent)
{
$config = KunenaFactory::getConfig();

if (isset($config->template)) {
if ($config->template == 'crypsis' || $config->template == 'crypsisb3' || $config->template == 'crypsisb4' || $config->template == 'blue_eagle5') {
$config->set('template', 'aurelia');
}
}

// Save configuration
$config->save();

return ['action' => '', 'name' => Text::_('COM_KUNENA_INSTALL_5215_SET_AURELIA_AS_DEFAULT_IN_CONFIGURATION'), 'success' => true];
}

0 comments on commit a9b5d2d

Please sign in to comment.