WordPress.org

Ready to get started?Download WordPress

Forums

P2
Crash with only one user (10 posts)

  1. alan.cleaver
    Member
    Posted 2 years ago #

    Getting:

    <b>Fatal error</b>: Cannot use object of type stdClass as array in <b>/usr/share/wordpress/wp-content/themes/p2/inc/mentions.php</b> on line <b>62</b>

    Line 60 in /inc/mentions.php

    foreach ( $wpdb->get_results( "SELECT ID, user_nicename from $wpdb->users WHERE ID IN($user_ids)" ) as $user ) {

    Doesn't make sense when there's only one user.

    Although this is a trivial issue to overcome when the cause is known, it's also trivial to fix in the code. Being a Debian user (on slightly older WordPress version), on a clean install this nearly caused me to drop the use of this theme.

    http://wordpress.org/extend/themes/p2/

  2. Lance Willett
    Themer
    Posted 2 years ago #

    Thanks for the report, Alan. I wasn't able to reproduce, though.

    Could you give us details on your WP version? And you said you only have one user, right ? ((I'm assuming it's an admin user.)

  3. alan.cleaver
    Member
    Posted 2 years ago #

    I'm using 3.0.5

    It was just one admin user. The default theme was working fine, but when switching to p2, I just got a crash. I'm no expert, but I think the statement:

    $wpdb->get_results( "SELECT ID, user_nicename from $wpdb->users WHERE ID IN($user_ids)")

    returns a single object (not an array of objects) when there is only one hit record returned by the SQL statement. Hence the 'foreach as' construct won't work.

    Let me know if you need more information, as at the moment, because I haven't started using the blog for real, this issue is easy to replicate.

  4. Lance Willett
    Themer
    Posted 2 years ago #

    Alan,
    This is due to the old version of WP, not a code issue. Could you update to at least 3.1—3.2 would be better.

  5. alan.cleaver
    Member
    Posted 2 years ago #

    This is a code issue, as it's crashing with a PHP error. A simple fix to the current version of the p2 theme would fix this and properly support older versions of WP.

    WordPress Version 3.0.5 is what you get on the latest Debian release (i.e. Squeeze). So upgrading is not an option for some of us, who want to stay with the Debian update process.

    It's a shame because if you using this WP version, are doing a fresh install of a site and use this theme straight away the site is unusable. Many people may just go on and use a different blogging software and/or theme. This is a shame as the p2 theme seems actually very good and would do a great job in many organisations and groups.

  6. Lance Willett
    Themer
    Posted 2 years ago #

    Could you post the contact info for Debian Squeeze devs? I'll be happy to contact them ASAP. We should ask them nicely to use the latest, stable version of WP. It's been a long time since 3.0.5 and there are many, many fixes and security updates.

  7. Lance Willett
    Themer
    Posted 2 years ago #

    Also note that testing with WP version 3.1 and 3.2 with one user did not produce the reported issue.

    We'll take a look at fixing it for older versions, also.

  8. Lance Willett
    Themer
    Posted 2 years ago #

    Found it: http://packages.qa.debian.org/w/wordpress.html

    Looks like 3.2.1 is in the testing stages.

  9. alan.cleaver
    Member
    Posted 2 years ago #

  10. Lance Willett
    Themer
    Posted 2 years ago #

    Hi Alan,
    Could you try again with your WP install and the latest P2 version? 1.3.3 is ready, and should fix the PHP errors.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic