Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Missing slug field deletes the whole folder #52

Closed
anton-mellit opened this issue Apr 11, 2020 · 1 comment
Closed

Missing slug field deletes the whole folder #52

anton-mellit opened this issue Apr 11, 2020 · 1 comment
Assignees
Labels

Comments

@anton-mellit
Copy link

Suppose slug_field is given but for some reason the corresponding field is empty. Or suppose title is empty. In these cases the plugin will delete the whole parent folder. I think this is very dangerous (this happened to me, fortunately I had a backup).

I don't know if this is the intended behavior. In my copy I added

if (empty($slug)) {
    throw new \RuntimeException('Empty slug for a new page. Prevented deleting the whole folder.');
}
@bleutzinn
Copy link
Owner

Fixed in release 2.4.1
I've changed the exception into a form validation error message.

Thanks for reporting.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants