You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
namespace App\Form\FormBundle;
use CORS\Bundle\FriendlyCaptchaBundle\Form\Type\FriendlyCaptchaType;
use CORS\Bundle\FriendlyCaptchaBundle\Validator\FriendlyCaptchaValid;
use Sulu\Bundle\FormBundle\Dynamic\FormFieldTypeConfiguration;
use Sulu\Bundle\FormBundle\Dynamic\FormFieldTypeInterface;
use Sulu\Bundle\FormBundle\Dynamic\Types\SimpleTypeTrait;
use Sulu\Bundle\FormBundle\Entity\FormField;
use Symfony\Component\Form\FormBuilderInterface;
/**
* FriendlyCaptcha form field type for SuluFormBundle
*
* @link https://friendlycaptcha.com
* @see https://github.com/sulu/SuluFormBundle
*
*/
class FriendlyCaptchaFieldType implements FormFieldTypeInterface
{
use SimpleTypeTrait;
public function getConfiguration(): FormFieldTypeConfiguration
{
return new FormFieldTypeConfiguration(
'FriendlyCaptcha',
__DIR__ . '/../../../config/form-bundle/field_friendlycaptcha.xml',
'special'
);
}
public function build(FormBuilderInterface $builder, FormField $field, string $locale, array $options): void
{
// Use in this way the friendlycaptcha bundle could maybe not exists.
$options['mapped'] = false;
$options['required'] = true;
$options['constraints'] = new FriendlyCaptchaValid();
$builder->add($field->getKey(), FriendlyCaptchaType::class, $options);
}
}
The text was updated successfully, but these errors were encountered:
Actual Behavior
Hidden field types are defined statically (see
SuluFormBundle/Entity/Dynamic.php
Line 36 in 12d2df1
When using own field types columns for these types are shown, even it has the
mapped
option set tofalse
.Expected Behavior
Own field types should have the possibility to be defined as a "hidden" field type so that for it no column in the data tab is shown.
Steps to Reproduce
Example for a FriendlyCaptcha field type
Type config:
Field type class:
The text was updated successfully, but these errors were encountered: