Skip to content

Commit

Permalink
Don't rely on MySQL defaults for node title field lengths
Browse files Browse the repository at this point in the history
  • Loading branch information
molovo committed Oct 12, 2021
1 parent 1bf22fd commit 9867852
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Kunstmaan/NodeBundle/Entity/AbstractPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ abstract class AbstractPage extends AbstractEntity implements PageInterface
/**
* @var string
*
* @ORM\Column(type="string")
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank()
* @Assert\Length(max=255)
*/
protected $title;

/**
* @var string
*
* @ORM\Column(type="string", nullable=true, name="page_title")
* @ORM\Column(type="string", nullable=true, name="page_title", length=255)
* @Assert\Length(max=255)
*/
protected $pageTitle;

Expand Down
4 changes: 4 additions & 0 deletions src/Kunstmaan/NodeBundle/Form/PageAdminType.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ public function buildForm(FormBuilderInterface $builder, array $options)
$builder->add('id', HiddenType::class);
$builder->add('title', TextType::class, [
'label' => 'kuma_node.form.page.title.label',
'attr' => [
'maxlength' => 255,
],
]);
$builder->add('pageTitle', TextType::class, [
'label' => 'kuma_node.form.page.page_title.label',
'attr' => [
'info_text' => 'kuma_node.form.page.page_title.info_text',
'maxlength' => 255,
],
]);
}
Expand Down

0 comments on commit 9867852

Please sign in to comment.