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
Description
An exception is thrown from ApiPlatform\Core\HttpCache\VarnishPurger line 70 with the message "Notice: Undefined offset: 0" when purging a single tag.
The purged tags are defined in class ApiPlatform\Core\Bridge\Doctrine\EventListener\PurgeHttpCacheListener as an associative array [ string => string ], for example in function gatherResourceAndItemTags :
114 $iri = $this->iriConverter->getIriFromResourceClass($resourceClass);
// $iri is supposed to be a string here because of getIriFromResourceClass signature !!!
115 $this->tags[$iri] = $iri;
Then this array is directly send to VarnishPurger from PurgeHttpCacheListener :
106 $this->purger->purge($this->tags);
But if this array contains a single asociation, VarnishPurger fails line 70 and throws an exception.
Possible Solution
Replace "ApiPlatform\Core\HttpCache\VarnishPurger" Line 70 :
yield $parts[0];
with:
yield array_shift($parts)
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
API Platform version(s) affected: 2.5.8
Description
An exception is thrown from
ApiPlatform\Core\HttpCache\VarnishPurger
line 70 with the message "Notice: Undefined offset: 0" when purging a single tag.The purged tags are defined in class
ApiPlatform\Core\Bridge\Doctrine\EventListener\PurgeHttpCacheListener
as an associative array [ string => string ], for example in functiongatherResourceAndItemTags
:Then this array is directly send to VarnishPurger from PurgeHttpCacheListener :
But if this array contains a single asociation, VarnishPurger fails line 70 and throws an exception.
Possible Solution
Replace "ApiPlatform\Core\HttpCache\VarnishPurger" Line 70 :
with:
The text was updated successfully, but these errors were encountered: