Restore from recycle bin failed #2165

Closed
opened 2026-02-05 03:10:22 +03:00 by OVERLORD · 8 comments
Owner

Originally created by @dusatvoj on GitHub (Mar 18, 2021).

Describe the bug
Somebody deleted a page. I've tried to restore it (Recycle bin -> restore). Now: page isn't in recycle bin even restored (can't find that page)

Steps To Reproduce
Steps to reproduce the behavior:

  1. Click on "restore page"
  2. Confirm
  3. Successfully restored pages: 0

Expected behavior
Successfully resotred page with link in clipboard / smth like this.

Screenshots
N/A

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): 0.31.2 (after that upgraded to latest)
  • PHP Version: v7.4.13
  • Hosting Method (Nginx/Apache/Docker): Apache2 + mod_php

Additional context
Add any other context about the problem here.

Originally created by @dusatvoj on GitHub (Mar 18, 2021). **Describe the bug** Somebody deleted a page. I've tried to restore it (Recycle bin -> restore). Now: page isn't in recycle bin even restored (can't find that page) **Steps To Reproduce** Steps to reproduce the behavior: 1. Click on "restore page" 2. Confirm 3. `Successfully restored pages: 0` **Expected behavior** Successfully resotred page with link in clipboard / smth like this. **Screenshots** N/A **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): `0.31.2` (after that upgraded to `latest`) - PHP Version: `v7.4.13` - Hosting Method (Nginx/Apache/Docker): Apache2 + `mod_php` **Additional context** Add any other context about the problem here.
Author
Owner

@ssddanbrown commented on GitHub (Mar 19, 2021):

Hi @dusatvoj,

There are some edge cases that can cause issues that we've fixed in more recent patch releases. I'm not sure what the latest in your issue refers to, but it's worth updating to v0.31.8 to help prevent these.

It may be the case you hit an issue that prevented the permissions for the page being built correctly.
You could attempt to regenerate these, after updating, by using the php artisan bookstack:regenerate-permissions command: https://www.bookstackapp.com/docs/admin/commands/#regenerate-access-permissions

@ssddanbrown commented on GitHub (Mar 19, 2021): Hi @dusatvoj, There are some edge cases that can cause issues that we've fixed in more recent patch releases. I'm not sure what the `latest` in your issue refers to, but it's worth updating to `v0.31.8` to help prevent these. It may be the case you hit an issue that prevented the permissions for the page being built correctly. You could attempt to regenerate these, after updating, by using the `php artisan bookstack:regenerate-permissions` command: https://www.bookstackapp.com/docs/admin/commands/#regenerate-access-permissions
Author
Owner

@dusatvoj commented on GitHub (Mar 19, 2021):

Hi @ssddanbrown ,
Yep, I mean latest release ... it's 0.31.8. I've tried to regenerate permissions php artisan bookstack:regenerate-permissions but the page looks lost. Maybe it's caused by some bug in v0.31.2 (the version I've tried to restore page). There's in DB still deleted_at date. Is that correct? (Maybe there's just something stuck in DB ... IDK)

@dusatvoj commented on GitHub (Mar 19, 2021): Hi @ssddanbrown , Yep, I mean latest release ... it's `0.31.8`. I've tried to regenerate permissions `php artisan bookstack:regenerate-permissions` but the page looks lost. Maybe it's caused by some bug in `v0.31.2` (the version I've tried to restore page). There's in DB still `deleted_at` date. Is that correct? (Maybe there's just something stuck in DB ... IDK)
Author
Owner

@ssddanbrown commented on GitHub (Mar 19, 2021):

There's in DB still deleted_at date. Is that correct? (Maybe there's just something stuck in DB ... IDK)

Hmm, No, That's not correct if it's been restored.
Setting the deleted_at date to null should make it re-appear.

@ssddanbrown commented on GitHub (Mar 19, 2021): > There's in DB still deleted_at date. Is that correct? (Maybe there's just something stuck in DB ... IDK) Hmm, No, That's not correct if it's been restored. Setting the `deleted_at` date to `null` should make it re-appear.
Author
Owner

@ssddanbrown commented on GitHub (Mar 19, 2021):

@dusatvoj As an extra note, is the parent book/chapter definitely not also in the recycle bin? That could also cause this behavior.

@ssddanbrown commented on GitHub (Mar 19, 2021): @dusatvoj As an extra note, is the parent book/chapter definitely not also in the recycle bin? That could also cause this behavior.
Author
Owner

@dusatvoj commented on GitHub (Mar 19, 2021):

I've set page's deleted_at to null and it's restored now.
Yes, It was our fault. Our co-workers told me that they deleted a page but they deleted a whole book. I've tried restore a page and bookstack told me success: 0 and page dissappeared from trash but not restored.
Is there a possibility (if it's not done yet in v0.31.8) to leave page in trash if restore wasn't success? This was confusing 😊

@dusatvoj commented on GitHub (Mar 19, 2021): I've set page's `deleted_at` to `null` and it's restored now. Yes, It was our fault. Our co-workers told me that they deleted a page but they deleted a whole book. I've tried restore a page and bookstack told me `success: 0` and page dissappeared from trash but not restored. Is there a possibility (if it's not done yet in `v0.31.8`) to leave page in trash if restore wasn't success? This was confusing :blush:
Author
Owner

@ssddanbrown commented on GitHub (Mar 19, 2021):

Thanks for confirming @dusatvoj.

Is there a possibility (if it's not done yet in v0.31.8) to leave page in trash if restore wasn't success? This was confusing

These edge-case scenarios get tricky. The page has been restored itself but the delete is still inferred by the parent. I'm pretty sure I handled this by showing a message when you attempt to restore an item in such a scenario:

Screenshot from 2021-03-19 14-07-26

@ssddanbrown commented on GitHub (Mar 19, 2021): Thanks for confirming @dusatvoj. > Is there a possibility (if it's not done yet in v0.31.8) to leave page in trash if restore wasn't success? This was confusing These edge-case scenarios get tricky. The page has been restored itself but the delete is still inferred by the parent. I'm pretty sure I handled this by showing a message when you attempt to restore an item in such a scenario: ![Screenshot from 2021-03-19 14-07-26](https://user-images.githubusercontent.com/8343178/111792997-b8c3c900-88bc-11eb-9edb-ba832fe17cfb.png)
Author
Owner

@dusatvoj commented on GitHub (Mar 19, 2021):

Oh, I've missed the message under restore button.
Thank you for your time.

@dusatvoj commented on GitHub (Mar 19, 2021): Oh, I've missed the message under restore button. Thank you for your time.
Author
Owner

@ssddanbrown commented on GitHub (Mar 19, 2021):

No problem! I'll keep this in mind though, If we start to see many other similar reports I'll look to tweak the user experience/feedback to make these more obvious.

@ssddanbrown commented on GitHub (Mar 19, 2021): No problem! I'll keep this in mind though, If we start to see many other similar reports I'll look to tweak the user experience/feedback to make these more obvious.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2165