mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
Merge branch '1.12' into 1.13
* 1.12: Remove the conflict for doctrine/orm 2.15.*
This commit is contained in:
commit
6eb12e9e75
14 changed files with 44 additions and 22 deletions
10
CONFLICTS.md
10
CONFLICTS.md
|
|
@ -13,14 +13,10 @@ references related issues.
|
|||
This version is missing the service alias `validator.expression`
|
||||
which causes ValidatorException exception to be thrown when using `Expression` constraint.
|
||||
|
||||
- `doctrine/orm:2.15.2`:
|
||||
- `doctrine/orm:>= 2.16.0`
|
||||
|
||||
This version introduced a bug, which causes the `ForeignKeyConstraintViolationException` exception to not be thrown when trying to delete a resource with a foreign key constraint.
|
||||
References: https://github.com/doctrine/orm/issues/10752
|
||||
|
||||
- `doctrine/orm:>=2.15.3`
|
||||
|
||||
This version introduced a bug, causing the bulk editing not to work properly. When deleting two items at once, the second one is deleted and re-added to the database.
|
||||
This version makes Sylius Fixtures loading fail on the product review fixtures.
|
||||
References: https://github.com/doctrine/orm/issues/10869
|
||||
|
||||
- `symfony/validator:5.4.25 || 6.2.12 || 6.3.1`
|
||||
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@
|
|||
"sylius/user-bundle": "self.version"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/orm": ">= 2.15.2",
|
||||
"doctrine/orm": ">= 2.16.0",
|
||||
"lexik/jwt-authentication-bundle": "^2.18",
|
||||
"stof/doctrine-extensions-bundle": "1.8.0",
|
||||
"symfony/framework-bundle": "6.2.8",
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
"symfony/intl": "^5.4.21 || ^6.0"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/orm": ">= 2.15.2",
|
||||
"doctrine/orm": ">= 2.16.0",
|
||||
"stof/doctrine-extensions-bundle": "1.8.0",
|
||||
"twig/twig": "^1.0 || ^3.0"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
"symfony/form": "^5.4.21 || ^6.0"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/orm": ">= 2.15.2",
|
||||
"doctrine/orm": ">= 2.16.0",
|
||||
"stof/doctrine-extensions-bundle": "1.8.0"
|
||||
},
|
||||
"config": {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
"twig/twig": "^2.12 || ^3.3"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/orm": ">= 2.15.2"
|
||||
"doctrine/orm": ">= 2.16.0"
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
"symfony/templating": "^5.4.21 || ^6.0"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/orm": ">= 2.15.2",
|
||||
"doctrine/orm": ">= 2.16.0",
|
||||
"twig/twig": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
"webmozart/assert": "^1.9"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/orm": ">= 2.15.2",
|
||||
"doctrine/orm": ">= 2.16.0",
|
||||
"twig/twig": "^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
"symfony/validator": "^5.4.21 || ^6.0"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/orm": ">= 2.15.2",
|
||||
"doctrine/orm": ">= 2.16.0",
|
||||
"twig/twig": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
"symfony/templating": "^5.4.21 || ^6.0"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/orm": ">= 2.15.2",
|
||||
"doctrine/orm": ">= 2.16.0",
|
||||
"twig/twig": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
"webmozart/assert": "^1.9"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/orm": ">= 2.15.2",
|
||||
"doctrine/orm": ">= 2.16.0",
|
||||
"twig/twig": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
"symfony/templating": "^5.4.21 || ^6.0"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/orm": ">= 2.15.2",
|
||||
"doctrine/orm": ">= 2.16.0",
|
||||
"stof/doctrine-extensions-bundle": "1.8.0",
|
||||
"twig/twig": "^1.0 || ^3.0"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Sylius\Bundle\ReviewBundle\EventListener;
|
||||
|
||||
use Doctrine\ORM\Event\PostRemoveEventArgs;
|
||||
use Doctrine\Persistence\Event\LifecycleEventArgs;
|
||||
use Sylius\Bundle\ReviewBundle\Updater\ReviewableRatingUpdaterInterface;
|
||||
use Sylius\Component\Review\Model\ReviewInterface;
|
||||
|
|
@ -46,6 +47,12 @@ final class ReviewChangeListener
|
|||
return;
|
||||
}
|
||||
|
||||
$this->averageRatingUpdater->update($subject->getReviewSubject());
|
||||
$reviewSubject = $subject->getReviewSubject();
|
||||
|
||||
if ($args instanceof PostRemoveEventArgs) {
|
||||
$reviewSubject->removeReview($subject);
|
||||
}
|
||||
|
||||
$this->averageRatingUpdater->update($reviewSubject);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,9 @@ declare(strict_types=1);
|
|||
|
||||
namespace spec\Sylius\Bundle\ReviewBundle\EventListener;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\Event\LifecycleEventArgs;
|
||||
use Doctrine\ORM\Event\PostRemoveEventArgs;
|
||||
use PhpSpec\ObjectBehavior;
|
||||
use Prophecy\Argument;
|
||||
use Sylius\Bundle\ReviewBundle\Updater\ReviewableRatingUpdaterInterface;
|
||||
|
|
@ -28,7 +30,7 @@ final class ReviewChangeListenerSpec extends ObjectBehavior
|
|||
}
|
||||
|
||||
function it_recalculates_subject_rating_on_accepted_review_deletion(
|
||||
$averageRatingUpdater,
|
||||
ReviewableRatingUpdaterInterface $averageRatingUpdater,
|
||||
LifecycleEventArgs $event,
|
||||
ReviewInterface $review,
|
||||
ReviewableInterface $reviewSubject,
|
||||
|
|
@ -41,8 +43,25 @@ final class ReviewChangeListenerSpec extends ObjectBehavior
|
|||
$this->recalculateSubjectRating($event);
|
||||
}
|
||||
|
||||
function it_does_nothing_if_event_subject_is_not_review_object($averageRatingUpdater, LifecycleEventArgs $event): void
|
||||
{
|
||||
function it_removes_a_review_from_a_review_subject_on_the_post_remove_event(
|
||||
ReviewableRatingUpdaterInterface $averageRatingUpdater,
|
||||
ReviewInterface $review,
|
||||
ReviewableInterface $reviewSubject,
|
||||
EntityManagerInterface $entityManager,
|
||||
): void {
|
||||
$event = new PostRemoveEventArgs($review->getWrappedObject(), $entityManager->getWrappedObject());
|
||||
$review->getReviewSubject()->willReturn($reviewSubject);
|
||||
|
||||
$reviewSubject->removeReview($review)->shouldBeCalled();
|
||||
$averageRatingUpdater->update($reviewSubject)->shouldBeCalled();
|
||||
|
||||
$this->recalculateSubjectRating($event);
|
||||
}
|
||||
|
||||
function it_does_nothing_if_event_subject_is_not_review_object(
|
||||
ReviewableRatingUpdaterInterface $averageRatingUpdater,
|
||||
LifecycleEventArgs $event
|
||||
): void {
|
||||
$event->getObject()->willReturn('badObject');
|
||||
|
||||
$averageRatingUpdater->update(Argument::type(ReviewableInterface::class))->shouldNotBeCalled();
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
"symfony/framework-bundle": "^5.4.21 || ^6.0"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/orm": ">= 2.15.2",
|
||||
"doctrine/orm": ">= 2.16.0",
|
||||
"stof/doctrine-extensions-bundle": "1.8.0",
|
||||
"twig/twig": "^3.0"
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue