1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-01 03:40:27 +02:00

Fix validation when move base folder and remove hidden pages from folder navi

This commit is contained in:
trendschau
2023-11-13 17:02:47 +01:00
parent 65533b3138
commit 8a7c7bf73d
6 changed files with 11 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ meta:
description: ' Restrict Access for the Website'
heroimage: null
heroimagealt: null
owner: trendschau
owner: Sebastian
author: null
allowedrole: null
alloweduser: null

View File

@@ -2,7 +2,7 @@ meta:
navtitle: 'write content'
title: 'Write Content'
description: 'Typemill provides easy and intuitive authoring tools and we work hard to create a good author experience. With the interactive navigation you can create pages'
owner: trendschau
owner: Sebastian
modified: '2023-05-11'
created: '2023-06-12'
time: 22-09-48

View File

@@ -4,7 +4,7 @@ meta:
description: 'If you found a bug or if you have a question, then please open a new issue on GitHub. Do you need professional help, an individual theme or a special plugin?'
heroimage: null
heroimagealt: null
owner: Sebastian
owner: trendschau
author: null
allowedrole: null
alloweduser: null

View File

@@ -108,6 +108,12 @@ class ControllerWebFrontend extends Controller
# DISPATCH LIVE NAVIGATION
$liveNavigation = $this->c->get('dispatcher')->dispatch(new OnPagetreeLoaded($liveNavigation), 'onPagetreeLoaded')->getData();
# For FOLDERS use item without drafts and hidden pages
if(!$home && $item->elementType == 'folder')
{
$item = $navigation->getItemWithKeyPath($liveNavigation, $keyPathArray);
}
# ADD BACKWARD-/FORWARD PAGINATION
$item = $navigation->getPagingForItem($liveNavigation, $item);
$item = $this->c->get('dispatcher')->dispatch(new OnItemLoaded($item), 'onItemLoaded')->getData();

View File

@@ -564,7 +564,7 @@ class Navigation extends Folder
}
public function getPagingForItem($navigation, $item)
{
{
# if page is home
if(trim($item->pathWithoutType, DIRECTORY_SEPARATOR) == 'index')
{

View File

@@ -461,7 +461,7 @@ class Validation
{
$v = new Validator($params);
$v->rule('required', ['item_id', 'parent_id_from', 'parent_id_to']);
$v->rule('required', ['item_id']);
$v->rule('regex', 'item_id', '/^[0-9.]+$/i');
$v->rule('regex', 'parent_id_from', '/^[a-zA-Z0-9.]+$/i');
$v->rule('regex', 'parent_id_to', '/^[a-zA-Z0-9.]+$/i');