This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Fatal error: Cannot use string offset as an array

Open 16 replies pluginplugin-page-builder
11 years ago · Last reply by Chris Risse 10 years ago

This is a follow up to a repeating error with the Page Builder plugin. Here are a couple associated threads about the same error:

– https://siteorigin.com/thread/error-message-on-styles-php/
– https://siteorigin.com/thread/fatal-error-cannot-use-string-offset-as-an-array

The problem first occurred in version 2.0.1, which was only fixed by recreating the page. Now the error appears after saving any page, with or without using page builder. In addition to appearing on the page, the error also appears in the metabox for the page builder.

Here is what I have tried:
– Disabled All Plugins
– Tried various versions of the page builder plugin
– Recreating page from scratch
– Default themes
– Database edits

Here is what I know:
The issue seems to lie with the saved data array for the page builder in the posts_meta table – meta_key panels_data, and possibly page revisions. By clearing the cell, or removing the cell, the associated page will display, but without the page builder data (of course).

Any insight and resolutions with this issue is greatly appreciated.

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Replies

16
  1. Greg Priday Staff 11 years, 15 days ago

    Hi Chris

    Do you have the full error message? It should have a file and line number. This would be a huge help in figuring out what’s happening.

    • Chris Risse 11 years, 15 days ago

      Greg, here is the error message:

      Fatal error: Cannot use string offset as an array in /home/mediarc/public_html/wp-content/plugins/siteorigin-panels/inc/styles.php on line 331

      • Greg Priday Staff 11 years, 15 days ago

        Perfect, thanks. I’m looking into this now.

      • Greg Priday Staff 11 years, 15 days ago

        So I can’t figure out what the situation is that would cause this problem, but I can add some checks to prevent it from coming up in the future. Would you be willing to try out a development version to see if the issue is fixed?

        • Chris Risse 11 years, 15 days ago

          Absolutely, sign me up!

  2. Greg Priday Staff 11 years, 15 days ago

    Here’s a copy of the development version of Page Builder with the fix in place.

    https://github.com/siteorigin/siteorigin-panels/archive/develop.zip

    Just make sure you disable the current version of Page Builder before installing this dev version. Hopefully this fixes the issue, if not, I’ll try harden it up a little more.

  3. Greg Priday Staff 11 years, 15 days ago

    Sorry, only pushed the changes now. The same URL will work.

  4. Chris Risse 11 years, 15 days ago

    Ok, I have the development plugin enabled with the release disabled. The same error is occurring.

    Fatal error: Cannot use string offset as an array in /home/mediarc/public_html/wp-content/plugins/siteorigin-panels-develop/inc/styles.php on line 331

    I created a new page to test with. I began by selecting the page builder tab, choosing a 2-column row, and used default WordPress widgets in either column. This worked as expected. Once the page was saved and reloaded, the Page Builder metabox displays the error from above. Ther Page Builder tab on the editor is missing, but the Text editor displays the HTML output generated by the the widgets, without Page Builder markup.

    • Chris Risse 11 years, 15 days ago

      Some additional info:

      After the page was published, a new revision was created in the database. panels_data displays the following:

      {“widgets”:[{“category”:””,”orderby”:”name”,”images”:”on”,”name”:”on”,”limit”:””,”panels_info”:{“class”:”WP_Widget_Links”,”raw”:true,”grid”:0,”cell”:0,”id”:0,”style”:{“class”:””,”widget_css”:””,”padding”:””,”background”:””,”background_image_attachment”:”0″,”background_display”:”tile”,”border_color”:””,”font_color”:””}}},{“title”:””,”sortby”:”post_title”,”exclude”:””,”panels_info”:{“class”:”WP_Widget_Pages”,”raw”:true,”grid”:0,”cell”:1,”id”:1}}],”grids”:[{“cells”:2,”style”:{}}],”grid_cells”:[{“grid”:0,”weight”:0.5},{“grid”:0,”weight”:0.5}]}

  5. Chris Risse 11 years, 13 days ago

    Have the PHP/MySQL requirements changed since the release of 2.0?

  6. Greg Priday Staff 11 years, 13 days ago

    That error message is useful. I split up the checks, so I at least know exactly where the problem is coming in. I'll tweak the development version as soon as I'm back at my laptop.

    To answer your other question, no, I don't think the requirements have changed. We're sticking to supporting the versions supported by WordPress itself.

  7. Chris Risse 11 years, 2 days ago

    Hey Greg, were you able to gain some insight into the issue? Let me know if you need anything from me to help figure it out.

  8. Greg Priday Staff 10 years, 11 months ago

    Thanks for your patience here Chris. I’ve added a few more checks to the development version of Page Builder. I’m hoping this fixes the issue, but either way, seeing where the new error message is, would be a big help. You can download it from our Github repo.

    https://github.com/siteorigin/siteorigin-panels

  9. Chris Risse 10 years, 11 months ago

    Well, we are certainly getting some where because the error(s) have changed. Here are the errors that display for the drafted page I was testing with, with 2 of the errors being created by the widgets bundle:

    Appeared just above the Page Builder during page edit – Warning: Invalid argument supplied for foreach() in /home/mediarc/public_html/wp-content/plugins/so-widgets-bundle/so-widgets-bundle.php on line 413

    Appeared above the Header on the page preview – Warning: Invalid argument supplied for foreach() in /home/mediarc/public_html/wp-content/plugins/so-widgets-bundle/so-widgets-bundle.php on line 413

    Appeared above the Header on the page preview – Warning: Invalid argument supplied for foreach() in /home/mediarc/public_html/wp-content/plugins/siteorigin-panels-develop/siteorigin-panels.php on line 801

    Appeared in the content area of the page preview – Warning: Invalid argument supplied for foreach() in /home/mediarc/public_html/wp-content/plugins/siteorigin-panels-develop/siteorigin-panels.php on line 608

    Appeared in the content area of the page preview – Warning: Invalid argument supplied for foreach() in /home/mediarc/public_html/wp-content/plugins/siteorigin-panels-develop/siteorigin-panels.php on line 680

  10. Greg Priday Staff 10 years, 11 months ago

    Glad we’re making little bits of progress here (better than no progress at all). So it looks like the broken Page Builder data is now making it through, which is causing problems later down the line.

    I actually think the best solution to this entire problem is to have a sanity check for all Page Builder as soon as it’s loaded. I’ll let you know when I have this working.

    • Chris Risse 10 years, 11 months ago

      Thanks, Greg. Much appreciated!

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread