Skip to content

Commit

Permalink
BUGFIX: Don't flush if tags is an empty array
Browse files Browse the repository at this point in the history
FOS Varnish will call array_chunk on the given tags with
the size of the tags array. If the tags are empty, an error
is thrown.
  • Loading branch information
paxuclus committed Jan 31, 2023
1 parent bbd38eb commit 34a8b22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Classes/Aspects/ContentCacheAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ public function registerDisableContentCache(JoinPointInterface $joinPoint): void
public function interceptContentCacheFlush(JoinPointInterface $joinPoint)
{
$object = $joinPoint->getProxy();

$tags = array_keys(ObjectAccess::getProperty($object, 'tagsToFlush', true));
if ($tags === []) {
return;
}

$this->varnishBanService->banByTags($tags);
}
Expand Down

0 comments on commit 34a8b22

Please sign in to comment.