Skip to content

Commit

Permalink
Merge pull request #2979 from molovo/master
Browse files Browse the repository at this point in the history
[NodeBundle] Don't rely on MySQL defaults for page title field lengths
  • Loading branch information
acrobat authored Oct 12, 2021
2 parents 1bf22fd + 9867852 commit f852860
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 f852860

Please sign in to comment.