Skip to content

Commit

Permalink
Fix form submit messages length (#10266)
Browse files Browse the repository at this point in the history
* Allow longer form submit message than 191 characters

* Review changes

* Run cs-fixer on migrations

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
Co-authored-by: Dennis Ameling (he/him) <dennis@dennisameling.com>
  • Loading branch information
3 people committed Nov 10, 2021
1 parent 7b85da4 commit 8dcf3ee
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
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
29 changes: 29 additions & 0 deletions app/migrations/Version20210623071326.php
@@ -0,0 +1,29 @@
<?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 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 ");
}
}

0 comments on commit 8dcf3ee

Please sign in to comment.