Skip to content

Commit

Permalink
Deprecate unused general.language setting (#16709)
Browse files Browse the repository at this point in the history
* Deprecate unused general.language setting

* Fix migration description

* Add upgrade note entry

* Move upgrade note to 11.3.0

---------

Co-authored-by: Christian F <christian.feldkirchner@pimcore.com>
  • Loading branch information
blankse and Corepex committed Mar 29, 2024
1 parent f5811da commit ef68e45
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ private function addGeneralNode(ArrayNodeDefinition $rootNode): void
->end()
->scalarNode('language')
->defaultValue('en')
->setDeprecated('pimcore/pimcore', '11.2')
->end()
->arrayNode('valid_languages')
->info('String or array format are supported.')
Expand Down
43 changes: 43 additions & 0 deletions bundles/CoreBundle/src/Migrations/Version20240229152000.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

declare(strict_types=1);

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\CoreBundle\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20240229152000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add language default value on users table';
}

public function up(Schema $schema): void
{
$this->addSql(
'ALTER TABLE `users` MODIFY `language` varchar(10) DEFAULT \'en\';'
);
}

public function down(Schema $schema): void
{
$this->addSql(
'ALTER TABLE `users` MODIFY `language` varchar(10) DEFAULT NULL;'
);
}
}
2 changes: 1 addition & 1 deletion bundles/InstallBundle/dump/install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ CREATE TABLE `users` (
`firstname` varchar(255) DEFAULT NULL,
`lastname` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`language` varchar(10) DEFAULT NULL,
`language` varchar(10) DEFAULT 'en',
`contentLanguages` LONGTEXT NULL,
`admin` tinyint(1) unsigned DEFAULT '0',
`active` tinyint(1) unsigned DEFAULT '1',
Expand Down
2 changes: 2 additions & 0 deletions doc/23_Installation_and_Upgrade/09_Upgrade_Notes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Pimcore 11.3.0
### General
#### [System Settings]
- Unused setting `general.language` has been deprecated.
#### [Listing]
- The methods `setOrder()` and `setOrderKey()` throw an `InvalidArgumentException` if the parameters are invalid now.

Expand Down
1 change: 0 additions & 1 deletion lib/SystemSettingsConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ private function prepareSystemConfig(array $values): array
'general' => [
'domain' => $values['general.domain'],
'redirect_to_maindomain' => $values['general.redirect_to_maindomain'],
'language' => $values['general.language'],
'valid_languages' => $filteredLanguages,
'fallback_languages' => $fallbackLanguages,
'default_language' => $values['general.defaultLanguage'],
Expand Down
3 changes: 1 addition & 2 deletions tests/Support/Resources/system_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"general": {
"domain": "pimcore-test.dev",
"redirect_to_maindomain": false,
"language": "en",
"valid_languages": [
"en",
"de",
Expand Down Expand Up @@ -36,4 +35,4 @@
"steps": 10
}
}
}
}

0 comments on commit ef68e45

Please sign in to comment.