From 7233312d6c960bae66a873d3df38917b79a30a00 Mon Sep 17 00:00:00 2001 From: Chihiro Adachi <8196725+chihiro-adachi@users.noreply.github.com> Date: Tue, 31 Aug 2021 19:44:57 +0900 Subject: [PATCH] =?UTF-8?q?Revert=20"=E7=AE=A1=E7=90=86=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=20=E5=95=86=E5=93=81=E3=81=AE=E3=82=BF=E3=82=B0=E3=81=A7?= =?UTF-8?q?=E3=81=AE=E7=B5=9E=E3=82=8A=E8=BE=BC=E3=81=BF"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 70813a434b4f4f5d21392e81fb1a74a065d028b2. --- .../Form/Type/Admin/SearchProductType.php | 26 +--------- src/Eccube/Repository/ProductRepository.php | 8 --- .../template/admin/Product/index.twig | 7 --- .../AbstractProductRepositoryTestCase.php | 31 +----------- ...ryGetQueryBuilderBySearchDataAdminTest.php | 49 ------------------- 5 files changed, 3 insertions(+), 118 deletions(-) diff --git a/src/Eccube/Form/Type/Admin/SearchProductType.php b/src/Eccube/Form/Type/Admin/SearchProductType.php index 785542252b1..72313c1656c 100644 --- a/src/Eccube/Form/Type/Admin/SearchProductType.php +++ b/src/Eccube/Form/Type/Admin/SearchProductType.php @@ -16,13 +16,10 @@ use Eccube\Entity\Category; use Eccube\Entity\Master\ProductStatus; use Eccube\Entity\ProductStock; -use Eccube\Entity\Tag; use Eccube\Form\Type\Master\CategoryType as MasterCategoryType; use Eccube\Form\Type\Master\ProductStatusType; use Eccube\Repository\CategoryRepository; use Eccube\Repository\Master\ProductStatusRepository; -use Eccube\Repository\TagRepository; -use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\DateTimeType; @@ -42,26 +39,16 @@ class SearchProductType extends AbstractType */ protected $categoryRepository; - /** - * @var TagRepository - */ - protected $tagRepository; - /** * SearchProductType constructor. * * @param ProductStatusRepository $productStatusRepository * @param CategoryRepository $categoryRepository - * @param TagRepository $tagRepository */ - public function __construct( - ProductStatusRepository $productStatusRepository, - CategoryRepository $categoryRepository, - TagRepository $tagRepository - ) { + public function __construct(ProductStatusRepository $productStatusRepository, CategoryRepository $categoryRepository) + { $this->productStatusRepository = $productStatusRepository; $this->categoryRepository = $categoryRepository; - $this->tagRepository = $tagRepository; } /** @@ -105,15 +92,6 @@ public function buildForm(FormBuilderInterface $builder, array $options) 'expanded' => true, 'multiple' => true, ]) - ->add('tag_id', EntityType::class, [ - 'class' => Tag::class, - 'label' => 'admin.product.tag', - 'placeholder' => 'common.select__all_products', - 'choice_label' => 'name', - 'required' => false, - 'multiple' => false, - 'expanded' => false, - ]) ->add('create_date_start', DateType::class, [ 'label' => 'admin.common.create_date__start', 'required' => false, diff --git a/src/Eccube/Repository/ProductRepository.php b/src/Eccube/Repository/ProductRepository.php index 1875ad879d2..8cda3600ba4 100644 --- a/src/Eccube/Repository/ProductRepository.php +++ b/src/Eccube/Repository/ProductRepository.php @@ -313,14 +313,6 @@ public function getQueryBuilderBySearchDataForAdmin($searchData) } } - // tag - if (!empty($searchData['tag_id']) && $searchData['tag_id']) { - $qb - ->innerJoin('p.ProductTag', 'pt') - ->andWhere('pt.Tag = :tag_id') - ->setParameter('tag_id', $searchData['tag_id']); - } - // crate_date if (!empty($searchData['create_datetime_start']) && $searchData['create_datetime_start']) { $date = $searchData['create_datetime_start']; diff --git a/src/Eccube/Resource/template/admin/Product/index.twig b/src/Eccube/Resource/template/admin/Product/index.twig index 48d8bdbdedd..9128bb83200 100644 --- a/src/Eccube/Resource/template/admin/Product/index.twig +++ b/src/Eccube/Resource/template/admin/Product/index.twig @@ -229,13 +229,6 @@ file that was distributed with this source code.
-
-
- - {{ form_widget(searchForm.tag_id) }} - {{ form_errors(searchForm.tag_id) }} -
-