You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Serializer/Normalizer/PublishableNormalizer.php
+2-12Lines changed: 2 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -173,15 +173,8 @@ public function denormalize($data, $type, $format = null, array $context = []):
173
173
174
174
// Any field has been modified: create a draft
175
175
// if we sent 2 simultaneous requests then the initial sql query will have got the live version even if there is a draft now, so let's re-check before creating
// todo: perhaps lock the database ona request for each resource? Or when we come to create a draft and then refresh / re-lookup the published resource here knowing it'll wait until the lock is over
@@ -254,9 +247,6 @@ public function createDraft(object $object, Publishable $configuration, string $
254
247
// Add draft object to UnitOfWork
255
248
$em->persist($draft);
256
249
257
-
// todo: perhaps we need to flush here so if we get another request before flushed, we do not get a duplicate key sql error trying to create a draft when one already exists
258
-
$em->flush($draft);
259
-
260
250
// Clear the cache of the published resource because it should now also return an associated draft
0 commit comments