About this topic

  • Posted by zdog 1 year ago. There are 6 posts. The latest reply is from byron.
  • This topic is resolved

No tags yet.

  1. I installed photosmash on our blog and once the plugin is activated, I get the error only on pages, but not on posts, categories, etc

    Fatal error: Call to a member function get() on a non-object in
    /path/to/wp-includes/query.php on line 27

    I haven't tried the beta version, using 0.8.00

    Suggestions?

    Thanks,
    Chris

  2. Hi zdog,

    I assume you're using a version of WordPress > 2.8. If the error goes away when you deactivate PhotoSmash, I'd recommend deactivating the plugin, deleting it through FTP, and then reloading it through Plugins > Add New. I'm wondering if somehow a file was corrupted or didn't get loaded properly or something.

    If that fails, then I'd check to see if there might be a conflict with another plugin you're running. You could deactivate everything except for PhotoSmash and see if that fixes it...if so, then there is likely a conflict with another plugin, and then it's just a matter of figuring out which one.

    I have just installed photosmash on a brand new WP 3.0 site and it seems to be working fine. It is running on several other sites as well without trouble, so hopefully it's not the plugin (but you never know).

    Let me know if you figure it out,
    Cheers,
    Byron

  3. Hi Byron,

    Thanks for the follow-up.

    I ssh'd in and rm -rf'd photosmash directory, removed all the photosmash tables from the DB and reinstalled via WP. Previously had ftp'd the .zip and unzipped via command line.

    Unfortunately, no luck. I went through each plugin and deactivated them one by one, but in every case the error, only on pages, not cats or posts, was triggered if photosmash was activated.

    I will have to replicate the environment on a non-production server to do some more extensive testing. If I find anything I will let you know.... we really want to use your plugin!

    Using 2.9.2.

    Thanks,
    Chris

  4. Hmmmm....that about covers everything except the Theme. You might try it with the standard WP theme and see if that makes it go away. I've got to say that this one is worrisome.

    Please let me know if you find something in the plugin causing this.
    BB

  5. Hi Bryon,

    Found the problem.

    I often use the PageofPosts code in my pages
    http://codex.wordpress.org/Pages

    It appears that unsetting the default $wp_query is the culprit

    $temp = $wp_query;  // assign orginal query to temp variable for later use
      $wp_query = null;
      $wp_query = new WP_Query($args);

    the code there attempts to reset the original query later on with

    $wp_query = $temp;

    but that doesn't work with photosmash.

    Putting the default query in $temp, then resetting it always felt like a crude hack. This one seems to be WP's fault as I can just as easily achieve the desired result of PageOfPosts by using $temp as such

    $args=array(...);
      $temp = new WP_Query($args);
      if( have_posts() ) :
    		while ($temp->have_posts()) : $temp->the_post();
                   ....
                    endwhile;
       unset($temp);

    Not sure what the long term solution is, but I fear anyone using Photosmash with the PageOfPosts code will run into the same issue.

    Thanks
    Chris

    p.s. Now I get to go play with Photosmash!

  6. Thanks for the clarification. If you can tell what I should do to prevent it, I'd be glad to give it a shot.

    Cheers,
    Byron

RSS feed for this topic