#11209 closed defect (bug) (wontfix)
Problem when Trash is disabled when something is already trashed
Reported by: | sirzooro | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.9 |
Component: | Trash | Keywords: | has-patch 2nd-opinion |
Focuses: | Cc: |
Description
When someone has some items trashed and then disable Trash (define EMPTY_TRASH_DAYS to 0), problems will appear:
- all trashed items disappears from admin UI;
- pages with trashed parents cannot be used as parents for other pages (they are not on the list);
- WP displays following PHP notices for every trashed page and page with trashed parent while displaying list of possible parent pages for edited page.
Notice: Undefined offset: 2 in C:\wordpress29.local\wp-includes\post.php on line 2603
Notice: Trying to get property of non-object in C:\wordpress29.local\wp-includes\post.php on line 2603
There may be more issues related to this.
Attachments (1)
Change History (11)
#2
@
15 years ago
For the 1st problem - If I disable the Trash, I would like to still see trashed items - e.g. just to delete them manually, before wp_cron will do this.
My setup: latest 2.9 nightly build, with default theme. I have most of my plugins installed and active, and WordPress Beta Tester. I use PHP 5.x (I will post exact version number later) with Xdebug. In wp-config.php I have WP_DEBUG and SCRIPT_DEBUG defined to true.
#3
@
15 years ago
Yeah; I see what you mean about the 1st problem - although the deletion by wp_cron will be pretty quick.
I'll make a patch later which causes trash to still b shown if there is anything in it.
Regarding the notices; would you mind trying a clean install without any plugins, just to eliminate the possibility that the notices are caused by a plugin?
Thanks.
#4
@
15 years ago
I use PHP/5.2.9-2 on Apache/2.2.13 on Windows XP Pro.
Regarding 1st issue - I had page in trash. Then I disabled trash and tried to reproduce few warnings posted here earlier. This took me a while and I loaded many backend pages, but page was not deleted - is was still in trash when I enabled it again.
Regarding 3rd issue - looks that this duplicate of #11205.
#5
@
15 years ago
- Keywords has-patch 2nd-opinion added; needs-patch removed
The patch resolves the issue by immediately emptying the trash when trash is disabled, rather than waiting until the next scheduled emptying (which could be up to 24 hours).
The patch also unschedules trash emptying when trash is disabled, so as not to waste resources.
Not sure that this immediate deletion is really necessary, but it does "fix" the "problem" described above where trash remains in the DB for up to 24 hours after setting EMpTY_TRASH_DAYS to 0.
#6
follow-up:
↓ 7
@
15 years ago
-1. Don't think this is a bug, it's expected behavior: if you hide the trash without emptying it, there will be some items in it... Changing EMPTY_TRASH_DAYS to 0 is not something that would happen couple of times per week anyways.
#7
in reply to:
↑ 6
@
15 years ago
Replying to azaozz:
-1. Don't think this is a bug, it's expected behavior: if you hide the trash without emptying it, there will be some items in it... Changing EMPTY_TRASH_DAYS to 0 is not something that would happen couple of times per week anyways.
I agree with this, and would leave the behaviour as is. This also provides a safety net for anyone who disables trash and then wishes they hadn't.
Anyway, the patch is there if it is decided that the behaviour should be changed.
#8
in reply to:
↑ 1
@
15 years ago
Replying to caesarsgrunt:
The second problem applies whether or not trash is disabled, and should be filed as a separate bug. I will do this in a minute.
Continued in #11235.
The first "problem" you've listed isn't really a problem - the items have been trashed and you don't want them restored. If anything you want them deleted when you disable trash, but as they will automatically be deleted anyway on the next run of wp_cron, this isn't an issue.
The second problem applies whether or not trash is disabled, and should be filed as a separate bug. I will do this in a minute.
The third problem - well, I don't get these notices.
I don't actually get any of the notices you've filed bugs for... what is your setup? Is it a plain default install of the latest trunk with no plugins etc? What version of PHP do you have?