Skip to content

Commit

Permalink
Merge pull request #6189 from mmikri/feature/fix_search_validation
Browse files Browse the repository at this point in the history
詳細検索での電話番号のバリデーションを修正
  • Loading branch information
dotani1111 authored May 29, 2024
2 parents 7dc38f4 + feebdad commit 5d33f08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
9 changes: 2 additions & 7 deletions src/Eccube/Form/Type/Admin/SearchCustomerType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Eccube\Form\Type\Master\PrefType;
use Eccube\Form\Type\Master\SexType;
use Eccube\Form\Type\PriceType;
use Eccube\Form\Type\PhoneNumberType;
use Eccube\Repository\Master\CustomerStatusRepository;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\BirthdayType;
Expand Down Expand Up @@ -140,15 +141,9 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'label' => 'admin.common.pref',
'required' => false,
])
->add('phone_number', TextType::class, [
->add('phone_number', PhoneNumberType::class, [
'label' => 'admin.common.phone_number',
'required' => false,
'constraints' => [
new Assert\Regex([
'pattern' => "/^[\d-]+$/u",
'message' => 'form_error.graph_and_hyphen_only',
]),
],
])
->add('buy_product_name', TextType::class, [
'label' => 'admin.order.purchase_product',
Expand Down
9 changes: 2 additions & 7 deletions src/Eccube/Form/Type/Admin/SearchOrderType.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Eccube\Form\Type\Master\OrderStatusType;
use Eccube\Form\Type\Master\PaymentType;
use Eccube\Form\Type\PriceType;
use Eccube\Form\Type\PhoneNumberType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
Expand Down Expand Up @@ -90,15 +91,9 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'label' => 'admin.order.order_no',
'required' => false,
])
->add('phone_number', TextType::class, [
->add('phone_number', PhoneNumberType::class, [
'label' => 'admin.common.phone_number',
'required' => false,
'constraints' => [
new Assert\Regex([
'pattern' => "/^[\d-]+$/u",
'message' => 'form_error.graph_and_hyphen_only',
]),
],
])
->add('tracking_number', TextType::class, [
'label' => 'admin.order.tracking_number',
Expand Down

0 comments on commit 5d33f08

Please sign in to comment.