Opened 15 years ago
Closed 15 years ago
#12245 closed defect (bug) (fixed)
Canonical Backtrace
Reported by: | miqrogroove | Owned by: | dd32 |
---|---|---|---|
Milestone: | 3.0 | Priority: | high |
Severity: | normal | Version: | 3.0 |
Component: | Canonical | Keywords: | has-patch |
Focuses: | Cc: |
Description
Disabled all plugins.
Hit path /?cat=1
WordPress throws this every time
[16-Feb-2010 04:44:34] PHP Notice: Trying to get property of non-object in /wp-includes/taxonomy.php on line 2299 [16-Feb-2010 04:44:34] PHP Warning: parse_url() expects parameter 1 to be string, object given in /wp-includes/canonical.php on line 152 [16-Feb-2010 04:44:34] PHP Notice: Trying to get property of non-object in /wp-includes/taxonomy.php on line 2299 [16-Feb-2010 04:44:34] PHP Warning: parse_url() expects parameter 1 to be string, object given in /wp-includes/canonical.php on line 152 [16-Feb-2010 04:44:34] PHP Warning: Cannot modify header information - headers already sent by (output started at /wp-includes/taxonomy.php:2298) in /wp-includes/pluggable.php on line 868
I have a backtrace stub taxonomy.php there. The Notices are both during redirect_canonical().
Not sure if this is a Canonical issue or something going on in Taxonomy? I'll keep looking.
Attachments (2)
Change History (12)
#2
@
15 years ago
see [13091] $slug = get_query_var('category_name');
probably has no value for /?cat=1
#3
@
15 years ago
- Cc ShaneF added
- Keywords has-patch added; needs-testing removed
- Owner changed from markjaquith to ShaneF
- Status changed from new to accepted
Attached is a patch.
#5
@
15 years ago
So this doesn't slip through, we should also fix get_term_link() to account for !$term in addition to is_wp_error($term).
#6
@
15 years ago
Two other problems so far:
- ShaneF's patch throws property of a non-object at
$slug = $_category_obj->slug;
- My patch doesn't add any errors, but I'm getting gobs of Notices in category-template.php and no proper 404's with either solution.
Note: See
TracTickets for help on using
tickets.
Fly-by debug: First one is we only check for WP_Error in get_term_link(), when get_term() may return null, get_term_by() may return false.
Second one is in redirect_canonical(), we're getting a return value of get_term_link() and not validating it a link, as it may be returning WP_Error, false, or null.
If the term doesn't exist, sounds like we should never get to this point, though.