Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion UserGroupsHooks.module
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class UserGroupsHooks extends WireData implements Module {

return array(
'title' => 'User Groups Hooks',
'version' => 14,
'version' => 16,
'summary' => 'Autoload module that attachs all the hooks required by User Groups.',
'singular' => true,
'autoload' => true,
Expand Down Expand Up @@ -585,6 +585,14 @@ class UserGroupsHooks extends WireData implements Module {
if ( ! isset($page) ) return false;
if ( ! $page->id ) return false;

// If this is a Repeater Page, access is managed elsewhere
if (strpos($page->url, $this->config->urls->admin . "repeaters/") === 0 && substr($page->template, 0, 9) == "repeater_") {
if (preg_match("/\/for-page-([0-9]+)\//", $page->url, $matches)) {
$page = $this->pages->get($matches[1]);
if (!$page->id) return false;
}
}

// If page doesn't have manage_access field at all, no need to continue
if ( ! $page->template->hasField($this->fieldManageAccess)) return false;

Expand Down