From f0233e3243d93a14105a54f008e4455e33b28d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Mon, 8 Apr 2019 16:01:51 +0200 Subject: [PATCH 1/2] EZP-30390: Removed deprecated ezprice field type --- data/demo_data.php | 2 +- doc/bc/changes-8.0.md | 3 + .../Resources/translations/fieldtypes.en.xlf | 5 -- .../Core/FieldType/Price/SearchField.php | 86 ------------------- .../Legacy/_fixtures/clean_ezdemo_47_dump.php | 6 +- .../Legacy/_fixtures/clean_ezflow_dump.php | 6 +- .../Legacy/Tests/Content/AbstractTestCase.php | 2 +- .../Tests/Content/HandlerContentTest.php | 12 +-- .../Tests/Content/HandlerLocationTest.php | 12 +-- .../Legacy/Tests/_fixtures/full_dump.php | 10 +-- eZ/Publish/Core/settings/fieldtypes.yml | 7 -- .../Core/settings/indexable_fieldtypes.yml | 7 -- .../legacy/field_value_converters.yml | 5 -- 13 files changed, 28 insertions(+), 135 deletions(-) delete mode 100644 eZ/Publish/Core/FieldType/Price/SearchField.php diff --git a/data/demo_data.php b/data/demo_data.php index 2e822d13785..59eab73b3f3 100644 --- a/data/demo_data.php +++ b/data/demo_data.php @@ -2863,7 +2863,7 @@ 'data_text3' => '', 'data_text4' => '', 'data_text5' => '', - 'data_type_string' => 'ezprice', + 'data_type_string' => 'ezfloat', 'id' => '216', 'identifier' => 'price', 'is_information_collector' => '0', diff --git a/doc/bc/changes-8.0.md b/doc/bc/changes-8.0.md index e89210df8a6..e7e0cfd596d 100644 --- a/doc/bc/changes-8.0.md +++ b/doc/bc/changes-8.0.md @@ -8,3 +8,6 @@ Changes affecting version compatibility with former or future versions. while the latest Elasticsearch release is 7.0. The support for this search engine will be provided once again as a separate bundle. + +* The following field type are not supported any more and have been removed: + * ezprice diff --git a/eZ/Bundle/EzPublishCoreBundle/Resources/translations/fieldtypes.en.xlf b/eZ/Bundle/EzPublishCoreBundle/Resources/translations/fieldtypes.en.xlf index c93ebf14b6e..1f034ad9644 100644 --- a/eZ/Bundle/EzPublishCoreBundle/Resources/translations/fieldtypes.en.xlf +++ b/eZ/Bundle/EzPublishCoreBundle/Resources/translations/fieldtypes.en.xlf @@ -96,11 +96,6 @@ Layout key: ezpage.name - - Price - Price - key: ezprice.name - Rich text Rich text diff --git a/eZ/Publish/Core/FieldType/Price/SearchField.php b/eZ/Publish/Core/FieldType/Price/SearchField.php deleted file mode 100644 index af905960f15..00000000000 --- a/eZ/Publish/Core/FieldType/Price/SearchField.php +++ /dev/null @@ -1,86 +0,0 @@ -value->sortKey['sort_key_int'] / 1000, - new Search\FieldType\PriceField() - ), - new Search\Field( - 'fulltext', - $field->value->sortKey['sort_key_int'] / 1000, - new Search\FieldType\FullTextField() - ), - ); - } - - /** - * Get index field types for search backend. - * - * @return \eZ\Publish\SPI\Search\FieldType[] - */ - public function getIndexDefinition() - { - return array( - 'value' => new Search\FieldType\PriceField(), - ); - } - - /** - * Get name of the default field to be used for matching. - * - * As field types can index multiple fields (see MapLocation field type's - * implementation of this interface), this method is used to define default - * field for matching. Default field is typically used by Field criterion. - * - * @return string - */ - public function getDefaultMatchField() - { - return 'value'; - } - - /** - * Get name of the default field to be used for sorting. - * - * As field types can index multiple fields (see MapLocation field type's - * implementation of this interface), this method is used to define default - * field for sorting. Default field is typically used by Field sort clause. - * - * @return string - */ - public function getDefaultSortField() - { - return $this->getDefaultMatchField(); - } -} diff --git a/eZ/Publish/Core/Repository/Tests/Service/Integration/Legacy/_fixtures/clean_ezdemo_47_dump.php b/eZ/Publish/Core/Repository/Tests/Service/Integration/Legacy/_fixtures/clean_ezdemo_47_dump.php index 14b844dd456..67b714f28ca 100644 --- a/eZ/Publish/Core/Repository/Tests/Service/Integration/Legacy/_fixtures/clean_ezdemo_47_dump.php +++ b/eZ/Publish/Core/Repository/Tests/Service/Integration/Legacy/_fixtures/clean_ezdemo_47_dump.php @@ -2379,11 +2379,11 @@ 'can_translate' => '1', 'category' => '', 'contentclass_id' => '19', - 'data_float1' => '1', + 'data_float1' => '0', 'data_float2' => '0', 'data_float3' => '0', 'data_float4' => '0', - 'data_int1' => '1', + 'data_int1' => '0', 'data_int2' => '0', 'data_int3' => '0', 'data_int4' => '0', @@ -2392,7 +2392,7 @@ 'data_text3' => '', 'data_text4' => '', 'data_text5' => '', - 'data_type_string' => 'ezprice', + 'data_type_string' => 'ezfloat', 'id' => '205', 'identifier' => 'price', 'is_information_collector' => '0', diff --git a/eZ/Publish/Core/Repository/Tests/Service/Integration/Legacy/_fixtures/clean_ezflow_dump.php b/eZ/Publish/Core/Repository/Tests/Service/Integration/Legacy/_fixtures/clean_ezflow_dump.php index b890587d3f8..2530318e0eb 100644 --- a/eZ/Publish/Core/Repository/Tests/Service/Integration/Legacy/_fixtures/clean_ezflow_dump.php +++ b/eZ/Publish/Core/Repository/Tests/Service/Integration/Legacy/_fixtures/clean_ezflow_dump.php @@ -3168,11 +3168,11 @@ 'can_translate' => '1', 'category' => '', 'contentclass_id' => '21', - 'data_float1' => '1', + 'data_float1' => '0', 'data_float2' => '0', 'data_float3' => '0', 'data_float4' => '0', - 'data_int1' => '1', + 'data_int1' => '0', 'data_int2' => '0', 'data_int3' => '0', 'data_int4' => '0', @@ -3181,7 +3181,7 @@ 'data_text3' => '', 'data_text4' => '', 'data_text5' => '', - 'data_type_string' => 'ezprice', + 'data_type_string' => 'ezfloat', 'id' => '224', 'identifier' => 'price', 'is_information_collector' => '0', diff --git a/eZ/Publish/Core/Search/Legacy/Tests/Content/AbstractTestCase.php b/eZ/Publish/Core/Search/Legacy/Tests/Content/AbstractTestCase.php index 9b677bbea67..d3d053d3abf 100644 --- a/eZ/Publish/Core/Search/Legacy/Tests/Content/AbstractTestCase.php +++ b/eZ/Publish/Core/Search/Legacy/Tests/Content/AbstractTestCase.php @@ -102,7 +102,7 @@ protected function getConverterRegistry() 'ezdatetime' => new Converter\DateAndTimeConverter(), 'ezinteger' => new Converter\IntegerConverter(), 'ezstring' => new Converter\TextLineConverter(), - 'ezprice' => new Converter\IntegerConverter(), + 'ezfloat' => new Converter\FloatConverter(), 'ezurl' => new Converter\UrlConverter(), 'ezrichtext' => new Converter\RichTextConverter(), 'ezboolean' => new Converter\CheckboxConverter(), diff --git a/eZ/Publish/Core/Search/Legacy/Tests/Content/HandlerContentTest.php b/eZ/Publish/Core/Search/Legacy/Tests/Content/HandlerContentTest.php index 61e8cd7efe6..ce1c9ebe2e6 100644 --- a/eZ/Publish/Core/Search/Legacy/Tests/Content/HandlerContentTest.php +++ b/eZ/Publish/Core/Search/Legacy/Tests/Content/HandlerContentTest.php @@ -897,14 +897,14 @@ public function testFieldFilterContainsSimpleNoMatch() public function testFieldFilterBetween() { $this->assertSearchResults( - array(69, 71, 72), + array(186, 187), $this->getContentSearchHandler()->findContent( new Query( array( 'filter' => new Criterion\Field( - 'price', + 'publication_date', Criterion\Operator::BETWEEN, - array(10000, 1000000) + array(1190000000, 1200000000) ), 'limit' => 10, ) @@ -916,7 +916,7 @@ public function testFieldFilterBetween() public function testFieldFilterOr() { $this->assertSearchResults( - array(11, 69, 71, 72), + array(11, 186, 187), $this->getContentSearchHandler()->findContent( new Query( array( @@ -928,9 +928,9 @@ public function testFieldFilterOr() 'members' ), new Criterion\Field( - 'price', + 'publication_date', Criterion\Operator::BETWEEN, - array(10000, 1000000) + array(1190000000, 1200000000) ), ) ), diff --git a/eZ/Publish/Core/Search/Legacy/Tests/Content/HandlerLocationTest.php b/eZ/Publish/Core/Search/Legacy/Tests/Content/HandlerLocationTest.php index 2b3491ba9fa..abc1fe43d3f 100644 --- a/eZ/Publish/Core/Search/Legacy/Tests/Content/HandlerLocationTest.php +++ b/eZ/Publish/Core/Search/Legacy/Tests/Content/HandlerLocationTest.php @@ -1378,14 +1378,14 @@ public function testFieldFilterContainsSimpleNoMatch() public function testFieldFilterBetween() { $this->assertSearchResults( - array(71, 73, 74), + array(188, 189), $this->getContentSearchHandler()->findLocations( new LocationQuery( array( 'filter' => new Criterion\Field( - 'price', + 'publication_date', Criterion\Operator::BETWEEN, - array(10000, 1000000) + array(1190000000, 1200000000) ), 'limit' => 10, ) @@ -1397,7 +1397,7 @@ public function testFieldFilterBetween() public function testFieldFilterOr() { $this->assertSearchResults( - array(12, 71, 73, 74), + array(12, 188, 189), $this->getContentSearchHandler()->findLocations( new LocationQuery( array( @@ -1409,9 +1409,9 @@ public function testFieldFilterOr() 'members' ), new Criterion\Field( - 'price', + 'publication_date', Criterion\Operator::BETWEEN, - array(10000, 1000000) + array(1190000000, 1200000000) ), ) ), diff --git a/eZ/Publish/Core/Search/Legacy/Tests/_fixtures/full_dump.php b/eZ/Publish/Core/Search/Legacy/Tests/_fixtures/full_dump.php index 6825d8af8b1..d55bd18f706 100644 --- a/eZ/Publish/Core/Search/Legacy/Tests/_fixtures/full_dump.php +++ b/eZ/Publish/Core/Search/Legacy/Tests/_fixtures/full_dump.php @@ -3086,7 +3086,7 @@ 'data_text3' => '', 'data_text4' => '', 'data_text5' => '', - 'data_type_string' => 'ezprice', + 'data_type_string' => 'ezfloat', 'id' => '224', 'identifier' => 'price', 'is_information_collector' => '0', @@ -12578,7 +12578,7 @@ 'data_float' => '499', 'data_int' => NULL, 'data_text' => '', - 'data_type_string' => 'ezprice', + 'data_type_string' => 'ezfloat', 'id' => '271', 'language_code' => 'eng-US', 'language_id' => '2', @@ -12848,7 +12848,7 @@ 'data_float' => '199', 'data_int' => NULL, 'data_text' => '', - 'data_type_string' => 'ezprice', + 'data_type_string' => 'ezfloat', 'id' => '287', 'language_code' => 'eng-US', 'language_id' => '2', @@ -13002,7 +13002,7 @@ 'data_float' => '299', 'data_int' => NULL, 'data_text' => '', - 'data_type_string' => 'ezprice', + 'data_type_string' => 'ezfloat', 'id' => '296', 'language_code' => 'eng-US', 'language_id' => '2', @@ -13156,7 +13156,7 @@ 'data_float' => '99', 'data_int' => NULL, 'data_text' => '', - 'data_type_string' => 'ezprice', + 'data_type_string' => 'ezfloat', 'id' => '305', 'language_code' => 'eng-US', 'language_id' => '2', diff --git a/eZ/Publish/Core/settings/fieldtypes.yml b/eZ/Publish/Core/settings/fieldtypes.yml index 5d88b113be7..c55e930e8cc 100644 --- a/eZ/Publish/Core/settings/fieldtypes.yml +++ b/eZ/Publish/Core/settings/fieldtypes.yml @@ -494,13 +494,6 @@ services: tags: - {name: ezpublish.fieldType, alias: ezpackage} - ezpublish.fieldType.ezprice: - class: "%ezpublish.fieldType.eznull.class%" - parent: ezpublish.fieldType - arguments: [ "ezprice" ] - tags: - - {name: ezpublish.fieldType, alias: ezprice} - ezpublish.fieldType.ezproductcategory: class: "%ezpublish.fieldType.eznull.class%" parent: ezpublish.fieldType diff --git a/eZ/Publish/Core/settings/indexable_fieldtypes.yml b/eZ/Publish/Core/settings/indexable_fieldtypes.yml index 7a11e8aacbb..7ba11f44a00 100644 --- a/eZ/Publish/Core/settings/indexable_fieldtypes.yml +++ b/eZ/Publish/Core/settings/indexable_fieldtypes.yml @@ -12,7 +12,6 @@ parameters: ezpublish.fieldType.indexable.ezobjectrelation.class: eZ\Publish\Core\FieldType\Relation\SearchField ezpublish.fieldType.indexable.ezbinaryfile.class: eZ\Publish\Core\FieldType\BinaryFile\SearchField ezpublish.fieldType.indexable.ezdate.class: eZ\Publish\Core\FieldType\Date\SearchField - ezpublish.fieldType.indexable.ezprice.class: eZ\Publish\Core\FieldType\Price\SearchField ezpublish.fieldType.indexable.ezgmaplocation.class: eZ\Publish\Core\FieldType\MapLocation\SearchField ezpublish.fieldType.indexable.ezcountry.class: eZ\Publish\Core\FieldType\Country\SearchField ezpublish.fieldType.indexable.ezinteger.class: eZ\Publish\Core\FieldType\Integer\SearchField @@ -39,11 +38,6 @@ services: tags: - {name: ezpublish.fieldType.indexable, alias: ezstring} - ezpublish.fieldType.indexable.ezprice: - class: "%ezpublish.fieldType.indexable.ezprice.class%" - tags: - - {name: ezpublish.fieldType.indexable, alias: ezprice} - ezpublish.fieldType.indexable.ezgmaplocation: class: "%ezpublish.fieldType.indexable.ezgmaplocation.class%" tags: @@ -155,7 +149,6 @@ services: - {name: ezpublish.fieldType.indexable, alias: ezmultiprice} - {name: ezpublish.fieldType.indexable, alias: ezoption} - {name: ezpublish.fieldType.indexable, alias: ezpackage} - - {name: ezpublish.fieldType.indexable, alias: ezprice} - {name: ezpublish.fieldType.indexable, alias: ezproductcategory} - {name: ezpublish.fieldType.indexable, alias: ezrangeoption} - {name: ezpublish.fieldType.indexable, alias: ezsrrating} diff --git a/eZ/Publish/Core/settings/storage_engines/legacy/field_value_converters.yml b/eZ/Publish/Core/settings/storage_engines/legacy/field_value_converters.yml index e4781729609..0ab66371fe6 100644 --- a/eZ/Publish/Core/settings/storage_engines/legacy/field_value_converters.yml +++ b/eZ/Publish/Core/settings/storage_engines/legacy/field_value_converters.yml @@ -202,11 +202,6 @@ services: tags: - {name: ezpublish.storageEngine.legacy.converter, alias: ezpackage} - ezpublish.fieldType.ezprice.converter: - class: "%ezpublish.fieldType.eznull.converter.class%" - tags: - - {name: ezpublish.storageEngine.legacy.converter, alias: ezprice} - ezpublish.fieldType.ezproductcategory.converter: class: "%ezpublish.fieldType.eznull.converter.class%" tags: From 20b86cdc8d1a7f69dd550b69eeb4775363e8b8d6 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 8 May 2019 20:46:13 +0200 Subject: [PATCH 2/2] Fixed typo in doc/bc/changes-8.0.md --- doc/bc/changes-8.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/bc/changes-8.0.md b/doc/bc/changes-8.0.md index e7e0cfd596d..e33a33cf69b 100644 --- a/doc/bc/changes-8.0.md +++ b/doc/bc/changes-8.0.md @@ -9,5 +9,5 @@ Changes affecting version compatibility with former or future versions. The support for this search engine will be provided once again as a separate bundle. -* The following field type are not supported any more and have been removed: +* The following Field Types are not supported any more and have been removed: * ezprice