WordPress.org

Ready to get started?Download WordPress

Forums

Betta Boxes CMS
[resolved] Headers already sent (9 posts)

  1. gothbarbie
    Member
    Posted 1 year ago #

    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?

    http://wordpress.org/extend/plugins/betta-boxes-cms/

  2. shauno
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  3. gothbarbie
    Member
    Posted 1 year ago #

    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

  4. shauno
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  5. shauno
    Member
    Plugin Author

    Posted 1 year ago #

    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

  6. gothbarbie
    Member
    Posted 1 year ago #

    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.

  7. shauno
    Member
    Plugin Author

    Posted 1 year ago #

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

    Does that change anything?

  8. gothbarbie
    Member
    Posted 1 year ago #

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

  9. shauno
    Member
    Plugin Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.