#34449 closed defect (bug) (fixed)
Remove CPT if exists menu item
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.4.1 | Priority: | normal |
Severity: | normal | Version: | 4.4 |
Component: | Menus | Keywords: | fixed-major |
Focuses: | Cc: |
Description
I add to menu Post Type Archive URL and i remove function register_post_type(). And i have notice:
Notice: Trying to get property of non-object in D:\xampp\htdocs\wordpress\wp-admin\includes\class-walker-nav-menu-edit.php on line 83
Error is in line $original_title = $original_object->labels->archives; because post object not exists
Attachments (4)
Change History (15)
#2
@
8 years ago
- Keywords has-screenshots added
- Severity changed from normal to major
Error still exists. I have plugin where I register post type. In menu add item "Post Type Archive". When I turn off my plugin in menu manager I have notice:
Notice: Trying to get property of non-object in /wp-admin/includes/class-walker-nav-menu-edit.php on line 83
Notice: Trying to get property of non-object in /wp-admin/includes/class-walker-nav-menu-edit.php on line 83
In attachment is screen of bug. My patch fixes this.
This ticket was mentioned in Slack in #core by sebastian.pisula. View the logs.
8 years ago
#5
@
8 years ago
- Keywords needs-testing added
- Severity changed from major to normal
Apart from the assignment in the condition the patch makes sense to me. Will test.
Related: #13958
#7
@
8 years ago
- Owner set to swisspiddy
- Status changed from new to assigned
@swisspiddy thanks for looking into this. Please update with anything you find.
#8
@
8 years ago
- Keywords commit added; needs-testing removed
The latest patch works great. No notices are shown.
#9
@
8 years ago
In general PHP Notices are not normally something that goes into a point release, as you shouldn't be running with display_errors enabled on a production site. Notices are not displayed by default.
#11
@
8 years ago
- Keywords fixed-major added; has-screenshots has-patch commit removed
re-opening for 4.4.1 consideration, based on the above, does anyone feel that it's a common scenario for a user to run into?
Especially considering PHP notices should require WP_DEBUG
to be on and display_errors
to be enabled in production.
I found error during save menu if CPT object not exists:
Notice: Trying to get property of non-object in wp-includes\nav-menu.php on line 408