Skip to content

Commit

Permalink
Merge pull request #4 from dfeyer/bugfix-clear-cache
Browse files Browse the repository at this point in the history
BUGFIX: RouterCachingService::flushCachesForUriPath accept only string
  • Loading branch information
dfeyer authored Sep 15, 2016
2 parents 2c1de85 + b8fe6f1 commit a775ad6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Classes/RedirectStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,16 @@ protected function updateDependingRedirects(RedirectInterface $newRedirect)
{
/** @var $existingRedirectForSourceUriPath Redirect */
$existingRedirectForSourceUriPath = $this->redirectRepository->findOneBySourceUriPathAndHost($newRedirect->getSourceUriPath(), $newRedirect->getHost(), false);
if ($existingRedirectForSourceUriPath !== null) {
$this->removeAndLog($existingRedirectForSourceUriPath, sprintf('Existing redirect for the source URI path "%s" removed.', $newRedirect->getSourceUriPath()));
$this->routerCachingService->flushCachesForUriPath($existingRedirectForSourceUriPath->getSourceUriPath());
}

/** @var $existingRedirectForTargetUriPath Redirect */
$existingRedirectForTargetUriPath = $this->redirectRepository->findOneBySourceUriPathAndHost($newRedirect->getTargetUriPath(), $newRedirect->getHost(), false);

if ($existingRedirectForTargetUriPath !== null) {
$this->removeAndLog($existingRedirectForTargetUriPath, sprintf('Existing redirect for the target URI path "%s" removed.', $newRedirect->getTargetUriPath()));
$this->routerCachingService->flushCachesForUriPath($existingRedirectForTargetUriPath);
}
if ($existingRedirectForSourceUriPath !== null) {
$this->removeAndLog($existingRedirectForSourceUriPath, sprintf('Existing redirect for the source URI path "%s" removed.', $newRedirect->getSourceUriPath()));
$this->routerCachingService->flushCachesForUriPath($existingRedirectForSourceUriPath);
$this->routerCachingService->flushCachesForUriPath($existingRedirectForTargetUriPath->getSourceUriPath());
}

$obsoleteRedirectInstances = $this->redirectRepository->findByTargetUriPathAndHost($newRedirect->getSourceUriPath(), $newRedirect->getHost());
Expand Down

0 comments on commit a775ad6

Please sign in to comment.