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

Fix form submit messages length #10266

Merged
merged 10 commits into from Nov 10, 2021
3 changes: 2 additions & 1 deletion app/bundles/FormBundle/Entity/Form.php
Expand Up @@ -13,6 +13,7 @@

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Mautic\ApiBundle\Serializer\Driver\ApiMetadataDriver;
use Mautic\CoreBundle\Doctrine\Mapping\ClassMetadataBuilder;
Expand Down Expand Up @@ -182,7 +183,7 @@ public static function loadMetadata(ORM\ClassMetadata $metadata)
->columnName('post_action')
->build();

$builder->createField('postActionProperty', 'string')
$builder->createField('postActionProperty', Types::TEXT)
->columnName('post_action_property')
->nullable()
->build();
Expand Down
30 changes: 30 additions & 0 deletions app/migrations/Version20210623071326.php
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

/*
* @copyright <year> Mautic Contributors. All rights reserved.
* @author Mautic
* @link https://mautic.org
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/

namespace Mautic\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\Exception\SkipMigration;
use Mautic\CoreBundle\Doctrine\AbstractMauticMigration;

final class Version20210623071326 extends AbstractMauticMigration
{
public function up(Schema $schema): void
{
$this->addSql("ALTER TABLE {$this->prefix}forms MODIFY post_action_property LONGTEXT ");
}

public function down(Schema $schema): void
{
$this->addSql("UPDATE {$this->prefix}forms SET post_action_property = left(post_action_property,191)");
$this->addSql("ALTER TABLE {$this->prefix}forms MODIFY post_action_property VARCHAR(191) DEFAULT NULL ");
}
}