1
0
mirror of https://github.com/typemill/typemill.git synced 2025-07-30 19:00:32 +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

@@ -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');