mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
Merge branch '1.11' into 1.12
* 1.11: [Adjustment] Adjustment cloning resets ID and timestamps [UI] Fix autocomplete empty value
This commit is contained in:
commit
7eb9370bd3
4 changed files with 22 additions and 2 deletions
|
|
@ -1,3 +1,7 @@
|
|||
# UPGRADE FROM `v1.11.7` TO `v1.11.8`
|
||||
|
||||
1. Cloning `Sylius\Component\Order\Model\Adjustment` resets values of fields `id`, `createdAt` and `updatedAt`.
|
||||
|
||||
# UPGRADE FROM `v1.11.6` TO `v1.11.7`
|
||||
|
||||
1. Method `Sylius\Component\Channel\Repository\ChannelRepository::findOneByHostname` has become deprecated, use
|
||||
|
|
|
|||
|
|
@ -41,10 +41,10 @@ $.fn.extend({
|
|||
value: item[choiceValue],
|
||||
}));
|
||||
|
||||
if (!element.hasClass('multiple')){
|
||||
if (!element.hasClass('multiple')) {
|
||||
results.unshift({
|
||||
name: ' ',
|
||||
value: ' ',
|
||||
value: '',
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,13 @@ class Adjustment implements AdjustmentInterface
|
|||
$this->createdAt = new \DateTime();
|
||||
}
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->id = null;
|
||||
$this->createdAt = new \DateTime();
|
||||
$this->updatedAt = null;
|
||||
}
|
||||
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
|
|
|
|||
|
|
@ -240,4 +240,13 @@ final class AdjustmentSpec extends ObjectBehavior
|
|||
$this->setDetails(['taxRateAmount' => 0.1]);
|
||||
$this->getDetails()->shouldReturn(['taxRateAmount' => 0.1]);
|
||||
}
|
||||
|
||||
function it_resets_internal_information_while_cloning(): void
|
||||
{
|
||||
$this->setUpdatedAt(new \DateTime());
|
||||
$new = clone $this->getWrappedObject();
|
||||
|
||||
$this->getCreatedAt()->shouldNotBe($new->getCreatedAt());
|
||||
$this->getUpdatedAt()->shouldNotBe($new->getUpdatedAt());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue