WordPress.org

Ready to get started?Download WordPress

Forums

Back End Instructions
[resolved] incompatible with YAPB (5 posts)

  1. helpdoc
    Member
    Posted 1 year ago #

    Warning: First parameter must either be an object or the name of an existing class in /home2/mobidemo/public_html/wp-content/plugins/yet-another-photoblog/lib/Yapb.class.php on line 821

    above error when i click on instructions or add a new

    deactivated YAPB plugin, no more errors

    http://wordpress.org/extend/plugins/back-end-instructions/

  2. Doodlebee
    Member
    Plugin Author

    Posted 1 year ago #

    That's not an error, that's a warning message (and it's also a warning message for the YAPB plugin, not for Back End Instructions. That's typically an error for a variable that isn't defined yet.) And error would mean it would make one plugin or the other no longer function.

    My guess is that it has something to do with the custom post types. Do the plugin not *work* when they are both activated? Or do you just get that warning message? (typically, a warning is nothing more than a "just letting you know" message - but it doesn't affect how the plugins actually *work*.) If one of the plugins don't *function*, then that would be good to know. otherwise, you can just shut off your e_notices in PHP. I think you can do that through your host, or through WordPress wp-config.php file.

  3. Doodlebee
    Member
    Plugin Author

    Posted 1 year ago #

    For the record, I've downloaded and installed the YAPB plugin on my testbed, and turned on the notices. The site is running Twenty Twelve, and only has my plugin and YAPB installed and activated. I don't get any warnings or error messages for either plugin - can't replicate the issue at all.

    Have you tried reverting your theme to default/deactivating all the other plugins to see if you still get the problem?

  4. Doodlebee
    Member
    Plugin Author

    Posted 1 year ago #

    Ah. I was finally able to replicate the problem. Even with my plugin shut off, there's still errors with YAPB. Under "All Posts" there's a notice:

    "Notice: Undefined property: Savant2::$image in /wp-content/plugins/yet-another-photoblog/tpl/manage_posts_custom_column.tpl.php on line 2"

    Yep - it looks like a conflict. I'm trying to work it out now.

  5. Doodlebee
    Member
    Plugin Author

    Posted 1 year ago #

    Okay - thanks for bringing this to my attention. You'll have to contact the YAPB plugin author, because really, only HE can fix the issue, since it's with his plugin. I have *no idea* why my plugin makes some of these errors show. All I know is that the warning you described you were seeing in the original post made me look at his class. Apparently he's recently popped in a fix for another issue - the fix was this exact line. So in that file (wp-content/plugins/yet-another-photoblog/lib/Yapb.class.php on line 821) the line he has is this:

    if ($post && property_exists($post, 'image')) {

    The problem is, he's just checking for a post of ANY type. Could be a post, a page, an attachment - or a Custom Post Type. Back End Instructions runs on Custom Post Types. So it looks like YAPB doesn't make any sort of differentiation between a regular post, and a CPT - so it's tossing out this error.

    I fixed it locally by changing that line to:

    if ($post['post_type'] == 'post' && property_exists($post, 'image')) {

    And BAM. Message goes away. Of course, this will only work until his next release - and if he doesn't do something about checking for CPT's, and you upgrade, your edit will be overwritten. But that's the best I can offer.

    Otherwise, I figured out a couple of the issues BEI was having, and I'm going to put out an update here in the morning to fix those bugs. between the two, your problem should be solved. But I would HIGHLY recommend you make the author of YAPB know about the issue with CPT's. otherwise, the issue will remain.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic