Skip to content

Commit

Permalink
[BUGFIX] Force to be field not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
georgringer committed Jun 18, 2024
1 parent 9effca0 commit ec22aae
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions Classes/Form/CustomFormElement.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

namespace StudioMitte\FriendlyCaptcha\Form;

use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Validation\Validator\NotEmptyValidator;
use TYPO3\CMS\Form\Domain\Model\FormElements\GenericFormElement;

class CustomFormElement extends GenericFormElement
{
public function initializeFormElement()
{
$this->addValidator(GeneralUtility::makeInstance(NotEmptyValidator::class));
}
}
2 changes: 1 addition & 1 deletion Configuration/Yaml/FormSetup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ TYPO3:

Friendlycaptcha:

implementationClassName: 'TYPO3\CMS\Form\Domain\Model\FormElements\GenericFormElement'
implementationClassName: 'StudioMitte\FriendlyCaptcha\Form\CustomFormElement'

# Headline (appears as a title in the overview and above the form)
formEditor:
Expand Down

0 comments on commit ec22aae

Please sign in to comment.