• Resolved sternhagel

    (@sternhagel)


    The bug is probably related to the NGG Voting plugin, but only shows up when using the Public Uploader Plugin. My configuration is WP 3.7.1 / NextGEN 2.0.33 / NextGEN PU 1.7.1 / NGG Voting 2.6.1.

    If you try to upload pictures with the Public Uploader Plugin, you only get the following error message:

    Fatal error: Call to a member function id() on a non-object in /wp-content/plugins/nextgen-gallery-voting/ngg-voting.php on line 1536

    Does anyone have an idea about this? Any help would be greatly appreciated.

    http://ww.wp.xz.cn/plugins/nextgen-public-uploader/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    I can give it a go later tonight to attempt recreation, but I agree it sounds more like a Voting plugin issue.

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Editing original reply:
    Not sure what’s up with that as I checked the Voting plugin code and it shouldn’t be getting that far if the current image being acted on isn’t an object. This is just from what I see looking at the code at least, as a first step.

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    After going to the Voting support forum, I noticed a couple of threads lamenting that ours isn’t yet compatible with the new NGG 2.x, which I find completely possible, so I’ll be contacting them to see how I can help get things better off.

    Thread Starter sternhagel

    (@sternhagel)

    Hi Michael, thanks for having a look at this.

    I did some debugging myself, and now it’s working, at least for me. The problem is, the image variable returned to the voting plugin when using Public Uploader is not an object but an array.
    I’m not sure whether this is a bug in the Public Uploader plugin, or if the check in the voting plugin is wrong. NGG Voting checks for the NextGEN version, and if it’s 2.x, it expects to get an object – if it’s 1.x it treats the image as an array. But when using 2.x with the public uploader, there’s an array, but the plugin expects an object – bam!

    My guess would be that NextGEN 1.x handled images as arrays, and 2.x handles them as objects – so you might consider rewriting the section of the Public Uploader to return an object instead of an array for NextGEN 2.

    On the other hand the handling of image arrays still seems to be working perfectly fine in NExtGEN 2, so it’s probably easier to patch the voting plugin to consider the image as an array if it’s not an object. That’s what I did as a quick fix for me, and it seems to work without any problems.

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Well, it was a little odd, but I think it’s a case of the Shauno, Voting Plugin author, hadn’t pushed out the change yet. I checked the trunk branch in his SVN repo and there was a line about is_object() which would have prevented ours from getting that far. However, I admit I didn’t check that same spot on the “stable” download, it was getting late in the night at that point.

    He replied to me about getting our plugin here better off, so I hope that that will help a lot.

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Also, if NextGEN 2.x is working with objects now instead of arrays, the 3rd party authors should be changing to objects as well. Part of the fun of being a 3rd party, keeping up with that which you extend.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Fatal PHP error when used with NGG Voting plugin’ is closed to new replies.