Skip to content

Commit

Permalink
Merge pull request #16 from bnomei/master
Browse files Browse the repository at this point in the history
php 8 and kirby3.7
  • Loading branch information
sylvainjule authored Aug 3, 2022
2 parents 9c2a624 + 33f1603 commit 78cb666
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'hooks' => [
'panel.route:before' => function($route, $path, $method) {
$user = kirby()->user();
if(!$user) return;
if(!$user || !$path) return;

if (str_starts_with($path, "dialogs")
|| str_starts_with($path, "dropdowns")
Expand Down
4 changes: 2 additions & 2 deletions lib/bouncer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static function getAllowedPages($user, $fieldname, $extra = false) {
foreach($pages as $page) {
$allowed[] = [
'title' => $page->title()->value(),
'path' => $page->panelUrl(true)
'path' => $page->panel()->url(true)
];

$children = $extra ? static::getChildren($page) : [];
Expand Down Expand Up @@ -44,7 +44,7 @@ private static function getChildren(Kirby\Cms\Page $page) {
foreach($pages as $p) {
$allowed[] = [
'title' => $p->title()->value(),
'path' => $p->panelUrl(true)
'path' => $p->panel()->url(true)
];

$children = static::getChildren($p);
Expand Down

0 comments on commit 78cb666

Please sign in to comment.