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
I faced an issue which caused redirect loop with simple mount points usage.
At some of mounted pages I got redirect loop, caused by wrong url data cache.
Steps to reproduce:
Create mount point page which refers to some other page with same names, but on different level and sub-tree.
Change page from MP to standard page
Open that page (so cache will be written)
Change it back to mount point
Obviously that simple RealUrl cache clearing for that page will solve the issue.
But in some cases cache was written even without that manipulation (which, unfortunately, I was unable to reproduce it, but it happens again after full realurl cache clearing, so still there can be some other issue which causes cache writing to mount point page with my or realurl configuration).
Reason of it was that method getUrlFromCacheBySpeakingUrl (DatabaseCache.php line 213) founds it as last written cache with such speaking url and select it, which causes redirect loop. because mount point refers to itself.
So I thought that possible workaround solution could be adding some additional check of cache candidates into that method.
Something like it could solve the issue:
$targetPage = $this->databaseConnection->exec_SELECTgetRows('doktype', 'pages',
'uid =' . (int)$rowCandidate['page_id']
);
// check if target page doktype is mount point. If yes - skip this cache entry
if ($targetPage[0]['doktype'] == 7) {
continue;
}
That will 100% solve that kind issues in any case, even if it's caused just by wrong usage. Mount point page is not cached anyway, so it's wrong to take cache from that page as result even if this is a last written record with such speaking url.
Or, maybe add some hook for such kind of cache "exclude"?
The text was updated successfully, but these errors were encountered:
I faced an issue which caused redirect loop with simple mount points usage.
At some of mounted pages I got redirect loop, caused by wrong url data cache.
Steps to reproduce:
Obviously that simple RealUrl cache clearing for that page will solve the issue.
But in some cases cache was written even without that manipulation (which, unfortunately, I was unable to reproduce it, but it happens again after full realurl cache clearing, so still there can be some other issue which causes cache writing to mount point page with my or realurl configuration).
Reason of it was that method
getUrlFromCacheBySpeakingUrl
(DatabaseCache.php
line 213) founds it as last written cache with such speaking url and select it, which causes redirect loop. because mount point refers to itself.So I thought that possible workaround solution could be adding some additional check of cache candidates into that method.
Something like it could solve the issue:
That will 100% solve that kind issues in any case, even if it's caused just by wrong usage. Mount point page is not cached anyway, so it's wrong to take cache from that page as result even if this is a last written record with such speaking url.
Or, maybe add some hook for such kind of cache "exclude"?
The text was updated successfully, but these errors were encountered: