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:
Grzegorz Sadowski 2022-08-25 10:57:32 +02:00
commit 7eb9370bd3
No known key found for this signature in database
GPG key ID: EF87FF4E6E3BD364
4 changed files with 22 additions and 2 deletions

View file

@ -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

View file

@ -41,10 +41,10 @@ $.fn.extend({
value: item[choiceValue],
}));
if (!element.hasClass('multiple')){
if (!element.hasClass('multiple')) {
results.unshift({
name: ' ',
value: ' ',
value: '',
});
}

View file

@ -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;

View file

@ -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());
}
}