Support » Plugin: Mesh - Page Builder » Error upon activation

  • Resolved TecBrat

    (@tecbrat)


    When I installed and then activated this plugin, I got the following error messages.

    Warning: array_keys() expects parameter 1 to be array, boolean given in /home/MYSITE/public_html/cms/wp-content/plugins/mesh/class.mesh-templates.php on line 115

    Warning: array_merge(): Argument #2 is not an array in /home/MYSITE/public_html/cms/wp-content/plugins/mesh/class.mesh-templates.php on line 116

    When I set up a 2 column template and added it to the bottom of my page, it looked right in the page editor, but when i saved the changes, saved the page and then viewed it on the site, the “columns” were just divs on top of each other. (I’d guess they are supposed to be inline-block and they are not.) I don’t know if the errors PHP errors are related to this or not. I tried it with short content (col 1, col2) and long content (lorem ipsum…), just to see if it made a difference.

Viewing 4 replies - 1 through 4 (of 4 total)
  • I decided to test this on a fresh install of WordPress 4.6.1 and got the following error messages when choosing “Activate”.

    Warning: array_keys() expects parameter 1 to be array, boolean given in /home/MYSITE/public_html/cms2/wp-content/plugins/mesh/class.mesh-templates.php on line 115

    Warning: array_merge(): Argument #2 is not an array in /home/MYSITE/public_html/cms2/wp-content/plugins/mesh/class.mesh-templates.php on line 116

    Warning: Cannot modify header information – headers already sent by (output started at /home/MYSITE/public_html/cms2/wp-content/plugins/mesh/class.mesh-templates.php:115) in /home/MYSITE/public_html/cms2/wp-includes/option.php on line 823

    Warning: Cannot modify header information – headers already sent by (output started at /home/MYSITE/public_html/cms2/wp-content/plugins/mesh/class.mesh-templates.php:115) in /home/MYSITE/public_html/cms2/wp-includes/option.php on line 824

    My experience would suggest that the header errors are just a symptom of the other errors.

    Despite the errors, it looks like it’s installed and activated. I visited the Mesh settings and enabled sections for “Posts” and “Pages”.

    I added a 2 column section to the sample page, published the section, updated the page, visited the page and the “Columns” were again over-under instead of side-by-side.

    I just encountered the same errors. It’s an issue with older versions of PHP. In my case it’s GoDaddy’s Managed WordPress. They use an ancient version of PHP where several functions, including array_keys(), won’t accept function return values as parameters.

    The solution that worked for me was assigning the function return value to a variable and using that as a parameter on class.mesh-templates.php.

    I replaced lines 115 and 116 with this:

    $mesh_post_types_array = get_option( ‘mesh_post_types’ );
    $mesh_post_types = array_keys( $mesh_post_types_array );
    $available_post_types = array_merge( array( ‘mesh_template’ ), $mesh_post_types );

    @aware Would you mind changing that bit during your next update? So far as I can tell, it’s otherwise working in PHP Version 5.4.45. Thanks!

    Plugin Author Aaron Ware

    (@aware)

    @tecbrat sorry for the delayed response. I guess I didn’t have a wordpress.org match setup for Mesh. @missmuttly good find! Our environments for Linchpin are 5.5 and up. I’ve started putting in some basic testing and I will make sure I throw in some older PHP version tests as well. I can make that change later on this evening and push out a fix. If you want you can also submit pull requests on github https://github.com/linchpinagency/mesh

    Thanks, @aware! I just created a pull request on GitHub: https://github.com/linchpinagency/mesh/pull/40

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error upon activation’ is closed to new replies.