Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Special Chars are corrupted in output channel definition #123

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions src/Migrations/Version20240823111615.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?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 OutputDataConfigToolkitBundle\Migrations;

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

final class Version20240823111615 extends AbstractMigration
{
public function getDescription(): string
{
return 'Migrate bundle_outputdataconfigtoolkit_outputdefinition table columns';
}

public function up(Schema $schema): void
{
$query = "ALTER TABLE `bundle_outputdataconfigtoolkit_outputdefinition` CHANGE COLUMN `configuration` `configuration` LONGTEXT
CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_bin' NULL DEFAULT NULL;";

$this->addSql($query);
}

public function down(Schema $schema): void
{
$query = "ALTER TABLE `bundle_outputdataconfigtoolkit_outputdefinition` CHANGE COLUMN `configuration` `configuration` LONGTEXT
CHARACTER SET 'latin1' NULL DEFAULT NULL;";

$this->addSql($query);
}
}
6 changes: 3 additions & 3 deletions src/Tools/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public function install(): void
`id` int(11) NOT NULL AUTO_INCREMENT,
`objectId` int(11) NOT NULL,
`classId` varchar(50) NOT NULL,
`channel` varchar(255) COLLATE utf8_bin NOT NULL,
`configuration` longtext CHARACTER SET latin1,
`channel` varchar(255) NOT NULL,
`configuration` longtext,
PRIMARY KEY (`id`),
UNIQUE KEY `Unique` (`objectId`,`classId`,`channel`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
Expand Down Expand Up @@ -78,7 +78,7 @@ public function uninstall(): void
$db->executeQuery('DROP TABLE IF EXISTS `' . Dao::TABLE_NAME . '`;');

$db->executeQuery("DELETE FROM users_permission_definitions WHERE `key` = 'bundle_outputDataConfigToolkit'");
if (self::isInstalled()) {
if ($this->isInstalled()) {
throw new InstallationException('Could not be uninstalled.');
}
}
Expand Down
Loading