WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#9784 closed defect (bug) (fixed)

catchable fatal error - category template line 24

Reported by: johnmyr Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.8
Component: Template Keywords: category template, catchable fatal error
Focuses: Cc:

Description

Found a possible bug when betatesting Hybrid 0.6 theme with 2.8 bleeding.

When using the get_the_term_list() function to show a post's categories with the default (non-pretty) permalink settings, I receive this error:

Catchable fatal error: Object of class stdClass could not be converted to string in ..\wp-includes\category-template.php on line 24

Code example::

get_the_term_list( $post->ID, 'category', 'Posted in', ', ', '' );

Change History (3)

comment:1 Denis-de-Bernardy5 years ago

  • Component changed from General to Template
  • Milestone set to 2.8
  • Resolution set to worksforme
  • Status changed from new to closed

works fine in kubrick. please re-open with a step by step procedure to reproduce.

comment:2 greenshady5 years ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Fails miserably in Kubrick for me too.

Step by step:

1) Set your permalinks to the default: http://localhost/?p=123.

2) Add this code within The Loop in index.php:

<?php echo get_the_term_list( $post->ID, 'category', 'Posted in ', ', ', '' ); ?>

This error is produced:

Catchable fatal error: Object of class stdClass could not be converted to string in C:\xampp\htdocs\wp-includes\category-template.php on line 24

comment:3 ryan5 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [11257]) Pass IDs, not objects, to get_category_link(). fixes #9784

Note: See TracTickets for help on using tickets.