• Resolved gothbarbie

    (@gothbarbie)


    Hello, I just updated to WordPress 3.5 and now I get an Error when posting using Betta Boxes CMS.

    Warning: Illegal string offset ‘__force_post’ in /wp-content/plugins/betta-boxes-cms/betta-boxes.php on line 100

    Warning: Illegal string offset ‘__force_post’ in /wp-content/plugins/betta-boxes-cms/betta-boxes.php on line 100

    Warning: Illegal string offset ‘__force_post’ /wp-content/plugins/betta-boxes-cms/betta-boxes.php on line 100

    Warning: Illegal string offset ‘__force_post’ in /wp-content/plugins/betta-boxes-cms/betta-boxes.php on line 100

    Warning: Illegal string offset ‘__force_post’ in /wp-content/plugins/betta-boxes-cms/betta-boxes.php on line 100

    Warning: Illegal string offset ‘__force_post’ in …/wp-content/plugins/betta-boxes-cms/betta-boxes.php on line 100

    Warning: Illegal string offset ‘__force_post’ in …/wp-content/plugins/betta-boxes-cms/betta-boxes.php on line 100

    Warning: Cannot modify header information – headers already sent by (output started at …/wp-content/plugins/betta-boxes-cms/betta-boxes.php:100) in …/wp-includes/pluggable.php on line 876

    Can I do something to fix this?

    https://www.ads-software.com/extend/plugins/betta-boxes-cms/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author shauno

    (@shauno)

    Hi gothbarbie
    It seems you have WP_DEBUG set on, or your host has a very strange error_reporting live setting.
    I made the mistake of not having WP_DEBUG on when I was developing betta boxes, so a few notices and warnings got through. When they are suppressed, they do not affect the working of the plugin or WP in anyway though, so you can turn off WP_DEBUG and everything will work as expected.

    Cleaning it up to run notice free is on my list of things to do, but it’s not a priority right now.

    Thanks for the feedback, much appreciated.

    Thread Starter gothbarbie

    (@gothbarbie)

    Hm, I had to google wp_debug, but then I found it in wp-config.php. It seems to be off already?

    define('WP_DEBUG', false);

    Can I turn the specific warning off manually somehow?

    This is row 100.

    if(is_array($val['__force_post']) && isset($val['__force_post']) && $val['__force_post'] == 1) { //be sure it's an array, or beware unsetting strings

    Plugin Author shauno

    (@shauno)

    Let me have a look at the code later, maybe there is something wrong that I’ve missed. I will let you know what I find ASAP.

    Plugin Author shauno

    (@shauno)

    I’m struggling to reproduce the error. How many meta boxes have you got? and what types of fields are setup in the boxes? Also, are they linked to posts or pages. I want to try replicate your setup to narrow any potential problems

    Thread Starter gothbarbie

    (@gothbarbie)

    I use 6 meta boxes for a custom post type I made, called ‘videos’.

    They only contain short texts, which are actually URLs to different
    content, that I then present depending on if a user is signed in or not, using a plugin called S2Members.

    So there is nothing fancy about the content, just simple strings.

    Plugin Author shauno

    (@shauno)

    Can you change line 100 to:
    if(isset($val['__force_post']) && is_array($val['__force_post']) && $val['__force_post'] == 1) {

    Does that change anything?

    Thread Starter gothbarbie

    (@gothbarbie)

    haha, yes it did! no error!
    what did you do? :O

    Plugin Author shauno

    (@shauno)

    I changed the order of operations, making sure to check that the array has the key set first.
    PHP is ‘loosely’ typed, which means you can pretty much haphazardly change variable types. This can create problems though where it confuses strings and arrays when they aren’t defined implicitly enough.

    I have released 1.1.3 with the update. Let me know if you have any more problems or questions.
    If the plugin is useful, feel free to leave a rating.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Headers already sent’ is closed to new replies.