mirror of
https://github.com/processwire/processwire.git
synced 2025-08-27 00:25:05 +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:
@@ -662,7 +662,14 @@ class ProcessPageView extends Process {
|
|||||||
$forPageID = substr($page->parent->name, strrpos($page->parent->name, '-') + 1); // for-page-(id)
|
$forPageID = substr($page->parent->name, strrpos($page->parent->name, '-') + 1); // for-page-(id)
|
||||||
$forPage = $this->wire('pages')->get((int) $forPageID);
|
$forPage = $this->wire('pages')->get((int) $forPageID);
|
||||||
// delegate viewable check to the page the repeater lives on
|
// 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;
|
return null;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user