1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-26 08:04:38 +02:00

Fix issue processwire/processwire-issues#625 where nested repeater with image field when combined with $config->pagefileSecure and access control without guest page-view permission was not appearing for logged-in non-superuser

This commit is contained in:
Ryan Cramer
2018-07-16 11:31:45 -04:00
parent 1404d1ef0f
commit 2fb5ebbc96

View File

@@ -662,7 +662,14 @@ class ProcessPageView extends Process {
$forPageID = substr($page->parent->name, strrpos($page->parent->name, '-') + 1); // for-page-(id)
$forPage = $this->wire('pages')->get((int) $forPageID);
// delegate viewable check to the page the repeater lives on
if($forPage->id && $forPage->viewable($field)) return $page;
if($forPage->id) {
if($forPage->viewable($field)) return $page;
if(strpos($forPage->template->name, 'repeater_') === 0) {
// go recursive for nested repeaters
$forPage = $this->checkAccessDelegated($forPage);
if($forPage && $forPage->id) return $forPage;
}
}
}
return null;
}