• Resolved mobilemuseumofart

    (@mobilemuseumofart)


    Hi! On my website yesterday, I noticed the following error code on my calendar page (located here).

    Warning: count(): Parameter must be an array or an object that implements Countable in /home/XXXXXX/public_html/wp-content/themes/mmoart/wpalchemy/MetaBox.php on line 2126

    I logged into the code editor of my website and changed the code from this:
    $cnt = count(!empty($this->meta[$n])?$this->meta[$n]:NULL);
    to this:
    $cnt = (!empty($this->meta[$n]))?count ($this->meta[$n]):0;

    Luckily, that took the error message off of my calendar page. However, I got into work today, and I noticed that error message is now on every page that has a header. like the page here.

    I’m not sure what happened, but if there are any suggestions, I’d love to hear them.

Viewing 4 replies - 1 through 4 (of 4 total)
  • @mobilemuseumofart

    There is already a patch in place for this fix :
    https://github.com/farinspace/wpalchemy/tree/master/wp-content/wpalchemy

    Your theme probably updated and over-wrote your changes, unless you are in a Child them.

    You can also suppress your Warnings. Just add this to your config file :
    ini_set(‘display_errors’,’Off’);
    ini_set(‘error_reporting’, E_ALL );
    define(‘WP_DEBUG’, false);
    define(‘WP_DEBUG_DISPLAY’, false);

    Thread Starter mobilemuseumofart

    (@mobilemuseumofart)

    I tried the patch for it, and I’m still getting the same error message.

    I also tried suppressing the warnings, and that did not work either. I just got more error messages at the top of the page.

    @mobilemuseumofart

    Did you add this as well :
    define(‘WP_DEBUG’, false);

    Then this (fixed the quotes) :
    ini_set(‘display_errors’,’Off’);
    ini_set(‘error_reporting’, E_ALL );
    define(‘WP_DEBUG’, false);
    define(‘WP_DEBUG_DISPLAY’, false);

    Thread Starter mobilemuseumofart

    (@mobilemuseumofart)

    Oh, man, I made the rookie mistake with the quotes. Went back in and fixed those, and now everything is working again. Thank you so much, @corrinarusso!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Issues with Metabox code’ is closed to new replies.