• Resolved randaloulton

    (@randaloulton)


    Under WordPress 4.0 with Genesis pages on which you put the shortcode, have this appearing on top of them:

    Warning: Illegal string offset ‘list_only’ in /home/airfr513/public_html/hotairfrying.com/wp-content/plugins/summary-child-pages/summary-child-pages.php on line 76

    Warning: Illegal string offset ‘id’ in /home/airfr513/public_html/hotairfrying.com/wp-content/plugins/summary-child-pages/summary-child-pages.php on line 83

    https://www.ads-software.com/plugins/summary-child-pages/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter randaloulton

    (@randaloulton)

    Hi there, the issue was… the plugin was actually fully working and continued to beautifully display the child summaries…

    but, that error code was appearing at the top of the page.

    I solved the problem by editing the plugin, and just inserting this

    ini_set( ‘display_errors’, ‘false’ );

    after the //commented out instructions, just before the plugin code actually got going, i.e.

    //[summary-child-pages]
    //[summary-child-pages id=parent_id]
    //[summary-child-pages list_only=”1″] = no images, excerpt and read more
    //start added
    ini_set( ‘display_errors’, ‘false’ );
    //end added

    For my money, this really is the best child summary plugin, so I hope it keeps on going strong for many moons yet.

    Cheers.

    Re-posting from my plugin review – here is an alternative option to fix this error:

    Great plugin, but is broken under PHP 5.4+ as the plugin attempts to pass a string in as an array (previous PHP versions were more forgiving and ignored the type error).

    If you’re getting the “Warning: Illegal string offset ‘list_only’…” error, a quick and dirty fix is to manually edit the plugin and insert the following code line into summary-child-pages.php on line 56 (inside the summary_child_pages function, right before the $list_only = $atts['list_only']; line):

    /* ---------------------------------------------------*/
      /* Version v1.0.0: Patch for error under PHP 5.4+ to   */
      /*  address the "Warning: Illegal string offset        */
      /* 'list_only'" issue. An array (not a string) is      */
      /* expected, so check & convert $atts string to array. */
      /* ----------------------------------------------------*/
      if (!is_array($atts)) {$atts=explode(',',$atts,0);}
      /* ----------------------------------------------------*/

    This checks to see if $atts is not an array, and converts it to one if so. If anyone has a better solution feel free to post it ??

    To the developer: Thanks for making such a useful little plugin, and if possible could you please fix this in the next update so it works properly with PHP 5.4+? Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Error code appearing’ is closed to new replies.