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

Deleting menu with submenu #162

Open
luya-bot opened this issue Nov 22, 2018 · 9 comments
Open

Deleting menu with submenu #162

luya-bot opened this issue Nov 22, 2018 · 9 comments

Comments

@luya-bot
Copy link

This issue has originally been reported by @liberosoft at luyadev/luya#1881.
Moved here by @nadar.


What steps will reproduce the problem?

During menu deletion with submenu whole branch disappears from admin panel, which is ok, but submenu item stays in the frontend. This submenu item is visible as a root now in the frontend and can't be found in admin panel.

What is the expected result?

Whole branch deleted (marked as is_deleted in database)

What do you get instead? (A Screenshot can help us a lot!)

submenu visible in the frontend

@nadar
Copy link
Member

nadar commented Nov 22, 2018

@liberosoft How is the frontend menu build? But yes indeed, it won't delete the nested elements.

@liberosoft
Copy link

I'm using code from luya-kickstarter:

                <?php foreach (Yii::$app->menu->findAll([
                    'depth' => 1,
                    'container' => 'default'
                ]) as $item): ?>
                    <li class="nav-item<?= $item->isActive ? ' active' : '' ?>">
                        <a class="nav-link" href="<?= $item->link; ?>"><?= $item->title; ?></a>
                    </li>
                <?php endforeach; ?>

@liberosoft
Copy link

Maybe it is a good idea not to delete nested elements, but they should be able to edit in admin cms panel

@nadar
Copy link
Member

nadar commented Nov 22, 2018

But those children are only available if you visite the deleted page - and it should not be possible to open the delete page url anymore...

@liberosoft
Copy link

Ok then, I think those children should be marked as deleted, or maybe block parent page deletion if it has children

@nadar nadar added prio: high and removed pkg:cms labels Feb 27, 2019
@nadar
Copy link
Member

nadar commented Feb 27, 2019

@luyadev/core @luyadev/maintainer So we are going to delete all children items? This has also a very big potential for frustration when you delete a page accidentally 😄

@boehsermoe
Copy link
Member

On delete a page with childs all of them should be mark as deleted. And also the user should get a notice that all child pages will be deleted/archived too. It makes no sense that pages are available in frontend but not in backend.

@TheMaaarc
Copy link
Member

I agree with @boehsermoe – I think with a warning it shouldn't be a problem that we delete the pages?

This issue goes hand in hand with #187.

@nadar
Copy link
Member

nadar commented Mar 5, 2019

@TheMaaarc @boehsermoe sounds good to me! So we could add a "special second alert" when a page has children.

@nadar nadar self-assigned this Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants