Forums

Catchable fatal error relating category-template.php on 2.7 (9 posts)

  1. bohoe
    Member
    Posted 11 months ago #

    Im using the Miniml theme, and WordPress 2.7
    After a while, having added posts and pages, and for no apparent reason I started to get this error:
    "Catchable fatal error: Object of class WP_Error could not be converted to string in /home/www/lizmckeon.com/test/wp-includes/category-template.php on line 105"

    Is this a 2.7 bug?

  2. bohoe
    Member
    Posted 11 months ago #

    The error above appears when this code is executed on home.php:
    <?php echo(get_category_parents($catz, TRUE, '')); ?>

  3. bohoe
    Member
    Posted 11 months ago #

    And I think has something to do with the permalinks, as when I go back from my custom "/%category%/%postname%" to the default "http://www.lizmckeon.com/test/?p=123" the error dissappears.

  4. bohoe
    Member
    Posted 11 months ago #

    Is there anyone out there with enough knowledge to give me a tip on how to use custom permalinks and still have a beautiful WordPress 2.7?

  5. babychen
    Member
    Posted 11 months ago #

    I see the same problem after upgrading to WP 2.7. But happens only with one theme.

    bohoe, have you found a solution?

  6. leonl
    Member
    Posted 11 months ago #

    I have same error because of this get_category_link($cat)When i turn permalinks to default everything is ok

  7. termy_raf
    Member
    Posted 8 months ago #

    Yes, I second that error.

    Wordpress 2.7
    get_category_link($cat) returns a catchable fatal error in the various theme pages - index / archive / single when anything other than the default permalink setting is used.

    When the default permalink is used, everything is ok.

    Is there a solution to this or is this a bug?

  8. fayetteflash
    Member
    Posted 4 months ago #

    I was getting it after upgrading. My issue was that there was a "." in my category name. So, get_category_ID_by_name wasn't resolving and that caused the get_category_link and get_cat_name to fail. Now, it works after much anguish.

  9. brian.shapiro
    Member
    Posted 3 weeks ago #

    To all---

    When you have pretty permalinks on, get_category_link will take a category object (returned by get_the_category), but when you have it off, get_category_link will only take a category id.

    Also it seems not to want to accept the term_id in the form of the object property ($category->term_id). I've had to first set it to a variable $term_id = $category->term_id, and then pass the variable into the function ($term_id).

    Its pretty easily resolvable on the user end--ust make sure to always pass it a term_id--but its pretty strange behavior for WordPress.

    It probably has to do with certain environment variables not being set up right when the permalink redirect rules are left out.

Reply

You must log in to post.

About this Topic