From 6f685f55b2ed9cbb4e6d2e3e9fe1fdf434af4278 Mon Sep 17 00:00:00 2001 From: Jochen Manz Date: Mon, 25 Sep 2017 10:39:29 +0200 Subject: [PATCH] Category bugfix (#231) * force category position to integer * remove greater than check --- .../ResponseParser/Category/CategoryResponseParser.php | 2 +- CHANGELOG.md | 4 ++++ Connector/Validator/Category/CategoryValidator.php | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Adapter/PlentymarketsAdapter/ResponseParser/Category/CategoryResponseParser.php b/Adapter/PlentymarketsAdapter/ResponseParser/Category/CategoryResponseParser.php index 7e11f4817..50182815d 100644 --- a/Adapter/PlentymarketsAdapter/ResponseParser/Category/CategoryResponseParser.php +++ b/Adapter/PlentymarketsAdapter/ResponseParser/Category/CategoryResponseParser.php @@ -153,7 +153,7 @@ public function parse(array $entry) 'parentIdentifier' => $parentCategoryIdentifier, 'shopIdentifiers' => $shopIdentifiers, 'imageIdentifiers' => $this->getImages($validDetails['0'], $result), - 'position' => $validDetails['0']['position'], + 'position' => (int) $validDetails['0']['position'], 'description' => $validDetails['0']['shortDescription'], 'longDescription' => $validDetails['0']['description'], 'metaTitle' => $validDetails['0']['metaTitle'], diff --git a/CHANGELOG.md b/CHANGELOG.md index 76d75c05d..bfd92e223 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [4.0.5] +### Fixed +- force category position to integer + ## [4.0.4] ### Added - prepayment is now mapped correctly diff --git a/Connector/Validator/Category/CategoryValidator.php b/Connector/Validator/Category/CategoryValidator.php index 4e58144cf..886d5cda6 100644 --- a/Connector/Validator/Category/CategoryValidator.php +++ b/Connector/Validator/Category/CategoryValidator.php @@ -36,7 +36,6 @@ public function validate($object) Assertion::allUuid($object->getImageIdentifiers(), null, 'category.imageIdentifiers'); Assertion::integer($object->getPosition(), null, 'category.position'); - Assertion::greaterOrEqualThan($object->getPosition(), 0, null, 'category.position'); Assertion::string($object->getDescription(), null, 'category.description'); Assertion::string($object->getLongDescription(), null, 'category.longDescription');