Opened 14 years ago
Closed 14 years ago
#15240 closed defect (bug) (fixed)
PHP Notice in edit.php
Reported by: | sbressler | Owned by: | |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | minor | Version: | 3.1 |
Component: | Warnings/Notices | Keywords: | has-patch |
Focuses: | Cc: |
Description
I'm currently getting the following PHP Notice on edit.php with WP_DEBUG on: Notice: Illegal member variable name in wp\wp-admin\includes\post.php on line 853
Attachments (2)
Change History (15)
#3
in reply to:
↑ 2
@
14 years ago
Replying to nacin:
Unrelated, it seems.
Oh, me trying to be (half-)helpful, I was just guessing from where the offending bit of code was, in and around some Post Type code, Archive Page, easy mistake to make! ;)
#4
@
14 years ago
I'm getting Notice: Undefined index: name in /home/wpdavis/webapps/trunk/wp-includes/capabilities.php on line 116
#5
@
14 years ago
Can't reproduce.
Latest trunk with WP_DEBUG set only complains about "Assigning the return value of new by reference is deprecated in wpdev/wp-settings.php on line 211".
No complaints about neither post.php (853 - which incidentally is in a comment) nor capabilities.php.
#6
@
14 years ago
- Cc sheri@… added
Unable to reproduce this error from the edit.php page: "Notice: Illegal member variable name in wp\wp-admin\includes\post.php on line 853"
I see different notices when trying to restore or permanently delete a trashed post:
To reproduce:
- Go to Posts and trash any post
- Click on Trash
- Click Restore or Delete Permanently
---> wp-admin/edit.php?post_status=trash&post_type=post&untrashed=1 (Restore)
---> wp-admin/edit.php?post_status=trash&post_type=post&deleted=1 (Delete Permanently)
---> Results in these notices: "PHP Notice: Trying to get property of non-object in wp-admin/includes/template.php on line 581
PHP Notice: Trying to get property of non-object in wp-admin/includes/template.php on line 590"
Tested with Chrome 9-dev, PHP version 5.3.3 and WordPress r16544.
#7
follow-up:
↓ 8
@
14 years ago
- Keywords has-patch added
- Version set to 3.1
Attached patch just returns from touch_time if $post is not present (as otherwise the function is fairly useless anyway). Seems to have the required result on the post list when you delete the last post in a section (e.g. trash) it now returns "no posts found" instead of the notice. (Against trunk)
#8
in reply to:
↑ 7
@
14 years ago
- Keywords needs-patch added; has-patch removed
Replying to mrmist:
Attached patch just returns from touch_time if $post is not present (as otherwise the function is fairly useless anyway). Seems to have the required result on the post list when you delete the last post in a section (e.g. trash) it now returns "no posts found" instead of the notice. (Against trunk)
Currently this bails even if not $for_post
ideally we should not be calling this code - comes from the quick edit code if there isn't a post to quick edit - we should fix that not this.
#10
@
14 years ago
Tracing this back a bit further, the call seems to come from edit.php. I can check for $post there, and the lack of the call does not seem to affect the quick edit view (unlike my previous patch, which broke it a bit.)
Hopefully this is more suitable.
Related: #13818
The offending piece of code on http://core.trac.wordpress.org/browser/trunk/wp-admin/includes/post.php#L853 would be
$query['posts_per_archive_page'] = -1;
so (might) be related to the Custom Post Type Archives?