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:
@@ -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();
|
||||
|
@@ -564,7 +564,7 @@ class Navigation extends Folder
|
||||
}
|
||||
|
||||
public function getPagingForItem($navigation, $item)
|
||||
{
|
||||
{
|
||||
# if page is home
|
||||
if(trim($item->pathWithoutType, DIRECTORY_SEPARATOR) == 'index')
|
||||
{
|
||||
|
@@ -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');
|
||||
|
Reference in New Issue
Block a user