diff --git a/UserGroupsHooks.module b/UserGroupsHooks.module index f442fe2..4a5afc9 100644 --- a/UserGroupsHooks.module +++ b/UserGroupsHooks.module @@ -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, @@ -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;