Skip to content

Commit

Permalink
FIX: Msf update Fields
Browse files Browse the repository at this point in the history
  • Loading branch information
BadPixxel committed Oct 13, 2020
1 parent a0e7580 commit 55c3eb0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion modules/splashsync/src/Objects/Product/AttributeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function updateAttribute()
//====================================================================//
// FORCE MSF FIELDS WRITING
$updateFields = $this->getMsfUpdateFields("Attribute");
if ($updateFields) {
if (is_array($updateFields)) {
$this->Attribute->setFieldsToUpdate($updateFields);
}
//====================================================================//
Expand Down
2 changes: 1 addition & 1 deletion modules/splashsync/src/Objects/Product/CRUDTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function update($needed)
//====================================================================//
// FORCE MSF FIELDS WRITING
$updateFields = $this->getMsfUpdateFields("Product");
if ($updateFields) {
if (is_array($updateFields)) {
$this->object->setFieldsToUpdate($updateFields);
}
if (true != $this->object->update()) {
Expand Down
9 changes: 4 additions & 5 deletions modules/splashsync/tests/L10MsfProductsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,10 @@ private function isAllowedFieldForTesting($field): bool
}
//====================================================================//
// Ensure Field is Msf Field
if (!isset($field->options, $field->options["shop"])) {
return false;
}
if (MSM::MODE_ALL == $field->options["shop"]) {
return false;
if (isset($field->options, $field->options["shop"])) {
if (MSM::MODE_ALL == $field->options["shop"]) {
return false;
}
}
if (!isset($field->id) || (false !== strpos($field->id, "_shop_"))) {
return false;
Expand Down

0 comments on commit 55c3eb0

Please sign in to comment.