Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

My forum also goes Bonk - Nillablog error

edited March 2012 in Vanilla 2.0 - 2.8

Hi there, thanks for taking the time to read my question. You see, my forum goes Bonk whenever I try and use this awesome theme of yours, and I really want to make it work correctly.

I already read the other question that says my forum goes bonk, and it didn't really help me at all, so I decided to start my own.

Here's the error that came up when using the debug code posted in the other question: pastie.org/3561720

The plugins that I'm using:

-Emotify

-Flagging

-Mcserver

-Minecraftatar

-Nillablog

-Split/Merge

-Tagging

-Topposters

-Twitter feeds

-Vanilla statistics

-Voting

-Who's online

-CLeditor

Best Answer

  • Options
    UnderDogUnderDog MVP
    edited March 2012 Answer ✓

    Good job pasting the debug information in pastie.
    Here's the error you should focus on:

    Fatal Error in NillaBlog.DiscussionModel_BeforeGet_Handler();

    array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object
    The error occurred on or near:
    /public_html/plugins/NillaBlog/class.nillablog.plugin.php

    It probably has nothing to do with the theme you're using

    It could be debugged easily, if you're up for it.

    170:       $Wheres = $Sender->EventArguments["Wheres"];
    171:        if (!array_key_exists("d.CategoryID", $Wheres) || !in_array($Wheres["d.CategoryID"], C("Plugins.NillaBlog.CategoryIDs")))
    172:            return;

    I think what happens here is that the $Wheres is an empty string (''). array_key_exists expects an array or an object and something else is passed, so, something is wrong when
    $Wheres = $Sender->EventArguments["Wheres"]; gets executed.

    You either figure out what is returned or add a little logic to the nillablog code:

    if(!array($Wheres))
    {
    echo "something is wrong and Wheres is not an array";
    }
    else
    {
    171:        if (!array_key_exists("d.CategoryID", $Wheres) || !in_array($Wheres["d.CategoryID"], C("Plugins.NillaBlog.CategoryIDs")))
    172:            return;
    }

    sorry, bad coding, but this will trigger some responses from the actual coders (hopefully)

    There was an error rendering this rich post.

Answers

  • Options
    UnderDogUnderDog MVP
    edited March 2012 Answer ✓

    Good job pasting the debug information in pastie.
    Here's the error you should focus on:

    Fatal Error in NillaBlog.DiscussionModel_BeforeGet_Handler();

    array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object
    The error occurred on or near:
    /public_html/plugins/NillaBlog/class.nillablog.plugin.php

    It probably has nothing to do with the theme you're using

    It could be debugged easily, if you're up for it.

    170:       $Wheres = $Sender->EventArguments["Wheres"];
    171:        if (!array_key_exists("d.CategoryID", $Wheres) || !in_array($Wheres["d.CategoryID"], C("Plugins.NillaBlog.CategoryIDs")))
    172:            return;

    I think what happens here is that the $Wheres is an empty string (''). array_key_exists expects an array or an object and something else is passed, so, something is wrong when
    $Wheres = $Sender->EventArguments["Wheres"]; gets executed.

    You either figure out what is returned or add a little logic to the nillablog code:

    if(!array($Wheres))
    {
    echo "something is wrong and Wheres is not an array";
    }
    else
    {
    171:        if (!array_key_exists("d.CategoryID", $Wheres) || !in_array($Wheres["d.CategoryID"], C("Plugins.NillaBlog.CategoryIDs")))
    172:            return;
    }

    sorry, bad coding, but this will trigger some responses from the actual coders (hopefully)

    There was an error rendering this rich post.

  • Options

    You're correct. It's not an error with the plugin, look at my post here for more info:
    vanillaforums.org/discussion/19374/my-forum-goes-bonk-when-applying-themes

  • Options

    @RegretZero : please see PM

    There was an error rendering this rich post.

Sign In or Register to comment.