Skip to content
Snippets Groups Projects
Commit 543a3514 authored by git's avatar git Committed by Matt Glaman
Browse files

Issue #3047357 by TwiiK, mglaman, davenelson, bojanz: Locked orders should not...

Issue #3047357 by TwiiK, mglaman, davenelson, bojanz: Locked orders should not automatically be refreshed on load
parent 481c85bb
No related branches found
No related tags found
No related merge requests found
......@@ -104,6 +104,11 @@ class OrderRefresh implements OrderRefreshInterface {
return FALSE;
}
// Only unlocked orders should be automatically refreshed.
if ($order->isLocked()) {
return FALSE;
}
// Accommodate long-running processes by always using the current time.
$current_time = $this->time->getCurrentTime();
$order_time = $order->getChangedTime();
......
......@@ -177,6 +177,13 @@ class OrderRefreshTest extends OrderKernelTestBase {
$order_refresh = $this->createOrderRefresh(mktime(23, 10, 0, 2, 24, 2016));
$this->order->setChangedTime(mktime(23, 0, 0, 2, 24, 2016));
$this->assertNotEmpty($order_refresh->needsRefresh($this->order));
// Locked order.
$this->order->lock();
$this->assertFalse($order_refresh->needsRefresh($this->order));
$this->order->unlock();
$this->assertTrue($order_refresh->needsRefresh($this->order));
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment