Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parent Page Not Automatically Selected When Adding New Page from Control Panel #3936

Closed
leigh-pointer opened this issue Mar 3, 2024 · 1 comment

Comments

@leigh-pointer
Copy link
Contributor

Description:
When adding a new page to a parent page from the Control Panel, the expected behavior is that the parent page should be automatically selected. However, currently, this functionality is not working as intended. It's worth noting that for the Admin Dashboard, where the parent is not known, the current method functions appropriately.

Steps to Reproduce:

Log in to the Control Panel.
Navigate to the page where you want to add a new sub-page.
Click on the option to add a new page.
Observe that the parent page is not automatically selected.
Expected Behavior:
When adding a new page to a parent page from the Control Panel, the parent page should be pre-selected, making the process more intuitive and efficient.

Actual Behavior:
The parent page is not automatically selected when adding a new page from the Control Panel.

Additional Notes:
This issue impacts the user experience by requiring manual selection of the parent page, which can lead to confusion and inefficiency, especially in scenarios where multiple levels of nesting are involved.

@sbwalker
Copy link
Member

sbwalker commented Mar 4, 2024

A change was made to the logic:

                if (_parent != null && !UserSecurity.IsAuthorized(PageState.User, RoleNames.Admin))
                {
                    // non-admins are authorized to create child pages of current page
                    _parentid = _parent.PageId.ToString();
                }

Historically, the reason why the current page was set as the default for the parent page is because in order to create a page the user must have Edit permissions for the parent page. However, if the user is an Admin then they have Edit permissions for ALL pages in the site - so the parent page could be defaulted to the root in this scenario.

However this would be a behaviorial change to how the UI has traditionally functioned so I will revert this change.

sbwalker added a commit that referenced this issue Mar 4, 2024
fix #3936 - parent page default when adding new pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants