Skip to content

Commit

Permalink
Merged PR 16981: Only update catalog if orders found
Browse files Browse the repository at this point in the history
## What's being changed

Order sync.

## Why it's being changed

In the event that no orders were found to sync, an SQL exception was thrown at `updateCatalog()`.

## How to review / test this change

- Check you have no orders to sync
- Run `n98-magerun sys:cron:run ddg_automation_order_and_quote_sync`
- No output in exception.log

Related work items: #99875
  • Loading branch information
sta1r committed Oct 23, 2019
1 parent 6b95dc7 commit 472b43f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions code/Dotdigitalgroup/Email/Model/Sales/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,12 @@ public function sync()
$this->_setImported($orderIdsForSingleSync, true);
}
}

// Mark ordered products as unprocessed
$this->updateCatalog(array_merge($orders, $ordersForSingleSync));

if ($this->countOrders > 0) {
// Mark ordered products as unprocessed
$this->updateCatalog(array_merge($orders, $ordersForSingleSync));
}

unset($this->accounts[$account->getApiUsername()]);
}

Expand Down

0 comments on commit 472b43f

Please sign in to comment.