Bug #81405

New pages are places at same level instead of under, when using the ContextMenu.

Added by Christer V over 2 years ago. Updated 5 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2017-06-01
Due date:
% Done:

0%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When one creates a new page using the ContextMenu they are placed at the same level as the page you clicked on, instead of under. This means that none admins can't create new pages when clicking on the root page.

Current behaviour, when add a new page on Page 1 as Admin
  • Root
    • Page2
    • Page 3

=>

  • Root
    • Page 1
    • Page 2
  • Page new

As none admin you get "Sorry, you didn't have proper permissions to perform this change."

Expected behaviour:
  • Root
    • Page 1
    • Page 2

=>

  • Root
    • Page 1
    • Page 2
    • Page new

newpage.png View (12.9 KB) Sybille Peters, 2019-04-12 12:34


Related issues

Related to TYPO3 Core - Bug #85260: Can not create new page via context menu on root page as editor Closed 2018-06-14

History

#1 Updated by Riccardo De Contardi about 2 years ago

  • Category set to Backend User Interface
  • Status changed from New to Needs Feedback

Hi, I wonder if this issue could be related https://forge.typo3.org/issues/72011.

Could you add a step-by-step guide about how to reproduce this issue, with some screenshots e.g. where you click exactly?
Could you also check with the latest master? Thank you!

#2 Updated by Riccardo De Contardi almost 2 years ago

  • Status changed from Needs Feedback to New

[Update]

#72011 is not related.

The issue is reproducible with 8.7.8 and 9.0.0-dev (latest master) with the following steps:

1) use a non-admin be user that can access the "home" page of your pagetree
2) click on home and bring up the context menu
3) use the "new" item (NOT the "more options > 'create new' wizard"!!)

Result:

Sorry, you didn't have proper permissions to perform this change.

No record creation permission for user 2 on page root node 1437745221

Explanation: "new" appends the page below the one where you are, at the same level. if you do that on the "home" page of your site, it throws the error because the editor can't access the root below (id=0).

The issue reporter suggests to modify the "new" behavior from "create a new page below" to "create a new page inside" the page from where you opened the menu.
I guess that this would be a breaking change, as it is a completely different behavior.

I wonder if a possible solution could be to remove the "new" command and just use the 'create new' wizard, that lets you choose the position, and only inside the page where you opened it.

#3 Updated by Riccardo De Contardi about 1 year ago

  • Related to Bug #85260: Can not create new page via context menu on root page as editor added

#4 Updated by Philip Burggraf 8 months ago

We ran into the same issue on version 9.5.4.

#5 Updated by Sybille Peters 5 months ago

I think the problem is the change of behavior and user interface between TYPO3 7 and 8 of creation of new pages. It's not really a bug, but I don't think current behavior is intuitively usable and should be improved. The solution for the editors could be to use the "Create new wizard" or drag and drop with "Create new pages" in the top (But again, how should they know? You shouldn't have to look in the documentation for something that simple, IMHO).

I tested this for 7, 8 and 9:

TYPO3 7

Page Actions -> New : opens page wizard where you can select position ("Select a position for the new page")

TYPO3 8

  • "New" (submenu "Page Actions" is omitted, which is good): directly creates page (under current page, not as subpage)
  • "More Options" > "Create new wizard" : opens page wizard
  • or use drag'n drop with "Create new pages" on the top.

TYPO3 9

same as 8

It appears, for TYPO3 8, the behavior was changed, so that "New" directly creates a page and creates it under current page (on same level). The page wizard is now more hidden. I think people will run into this problem often. Actually, I think you would rather expect the page to be created as subpage of current page and not on same level.

#6 Updated by Riccardo De Contardi 5 months ago

I add here for reference the comment https://forge.typo3.org/issues/85260#note-1 (closed as duplicate) to keep track of it.

Guido Schmechel wrote:

Can reproduce it with 9.4.dev

master\typo3\sysext\backend\Classes\Form\FormDataProvider\DatabaseUserPermissionCheck.php function addData()
if (is_array($result['parentPageRow']))

$result['parentPageRow'] is null if editor creates a page at root. Admin user has a separate check and returns simple true

master\typo3\sysext\backend\Classes\Form\FormDataProvider\DatabaseParentPageRow.php
This class should return correctly null if root level is accessed.

Maybe its okay to use $result['neighborRow'] if $result['parentPageRow'] is null.

After that the saving throws this exception:
1: Attempt to insert a record on page '[root-level]' (0) from table 'pages' without permissions. Or non-existing page.

master\typo3\sysext\core\Classes\DataHandling\DataHandler.php
checkRecordInsertAccess() get a negative value via resolveSortingAndPidForNewRecord()

So a simple abs() does the trick

Also available in: Atom PDF