Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#18063 closed defect (bug) (worksforme)

When viewing category view an error is thrown

Reported by: garyjob's profile garyjob Owned by: gary-teh's profile Gary Teh
Milestone: Priority: normal
Severity: trivial Version: 3.1.4
Component: Query Keywords:
Focuses: Cc:

Description (last modified by dd32)

This is the error


[Mon Jul 11 00:04:56 2011] [error] [client 127.0.0.1] PHP Warning: reset() [<a href='function.reset'>function.reset</a>]: Passed variable is not an array or object in C:\\applications\\nubee\\htdocs\\wp-includes\\query.php on line 2891, referer: http://wordpress_site/?category_name=game-zh-hans&lang=zh-hans&lang=zh-hans

This is the proposed fix:

if(isset($query['terms'] )){
	$term = get_term_by( $query['field'], reset( $query['terms'] ), $query['taxonomy'] );
}
else{
	$term = get_term_by( $query['field'], $query['terms'] , $query['taxonomy'] );				
}

Change History (3)

#1 @scribu
14 years ago

  • Description modified (diff)

#2 @dd32
14 years ago

  • Description modified (diff)

How can we re-create this warning? (I can't)

Can you re-create ot with all plugins disabled and the default theme active?

Version 0, edited 14 years ago by dd32 (next)

#3 @SergeyBiryukov
14 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Can't reproduce either.

Feel free to reopen with more information if there's still a problem.

Note: See TracTickets for help on using tickets.