Skip to content

Commit

Permalink
Fix item import (#511)
Browse files Browse the repository at this point in the history
* Version update

* fix include sorting

* change handling of important data

* update changelog

* change default values

* fix cs
  • Loading branch information
resslinger authored and Pfabeck committed Aug 27, 2019
1 parent ff69813 commit a1819fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Adapter/PlentymarketsAdapter/ReadApi/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ class Item extends ApiAbstract
*/
private $variationHelper;

private $attributes = [];
private $attributes = false;

private $barcodes = [];
private $barcodes = false;

private $propertyGroups = [];
private $propertyGroups = false;

private $propertyNames = [];
private $properties = false;

private $availabilities = [];
private $availabilities = false;

/**
* @var array
Expand Down Expand Up @@ -189,7 +189,7 @@ private function addAdditionalData(array &$elements)

private function getAttributes()
{
if (empty($this->attributes)) {
if (empty($this->attributes) && !is_array($this->attributes)) {
$this->attributes = $this->itemAttributesApi->findAll();
}

Expand All @@ -198,7 +198,7 @@ private function getAttributes()

private function getBarcodes()
{
if (empty($this->barcodes)) {
if (empty($this->barcodes) && !is_array($this->barcodes)) {
$this->barcodes = $this->itemBarcodeApi->findAll();
}

Expand All @@ -207,7 +207,7 @@ private function getBarcodes()

private function getPropertyGroups()
{
if (empty($this->propertyGroups)) {
if (empty($this->propertyGroups) && !is_array($this->propertyGroups)) {
$this->propertyGroups = $this->itemsPropertyGroupsApi->findAll();
}

Expand All @@ -216,7 +216,7 @@ private function getPropertyGroups()

private function getProperties()
{
if (empty($this->properties)) {
if (empty($this->properties) && !is_array($this->properties)) {
$this->properties = $this->itemsPropertyNamesApi->findAll();
}

Expand All @@ -225,7 +225,7 @@ private function getProperties()

private function getAvailabilities()
{
if (empty($this->availabilities)) {
if (empty($this->availabilities) && !is_array($this->availabilities)) {
$this->availabilities = $this->availabilitiesApi->findAll();
}

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [## [unreleased]]
### Fixed
- fix handling of important data on item sync (@lacodimizer)
- fix tax handling on order export (@lacodimizer)
- fixed wrong float cast (@ArvatisJohannes)

Expand Down

0 comments on commit a1819fc

Please sign in to comment.