• PHP engine version: 7.2.21
    WordPress Core version: 5.2.2

    WordPress debug log contained several entries like this:
    [09-Aug-2019 15:22:29 America/New_York] PHP Notice: Undefined variable: responsive_options in /var/www/vhosts/mysite.com/httpdocs/wp-content/themes/responsive/header.php on line 153

    Original line 153 since version 3.16

     if ( ( isset( $responsive_options['site_layout_option'] ) && ( 'full-width-layout' === $responsive_options['site_layout_option'] ) && ( ! ( is_home() || is_front_page() ) ) ) || in_array( $responsive_options['blog_posts_index_layout_default'], $responsive_blog_layout_columns, true ) ) { // notice how $responsive_options key-value of 'site_layout_option' is tested prior to reference BUT the key-value of 'blog_posts_index_layout_default' is NOT tested prior to reference.

    Here is my patch-fix to resolve the logged error condition, which simply wraps the “in_array()” with a set of parenthesis and couples it with a respective isset for the key-value:
    if ( ( isset( $responsive_options['site_layout_option'] ) && ( 'full-width-layout' === $responsive_options['site_layout_option'] ) && ( ! ( is_home() || is_front_page() ) ) ) || ( isset( $responsive_options['blog_posts_index_layout_default'] ) && in_array( $responsive_options['blog_posts_index_layout_default'], $responsive_blog_layout_columns, true ) ) ) {

    In addition, I would post this report in the help forum on the cyberchimps.com site but my account registration is “still pending approval”.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Theme Author CyberChimps

    (@cyberchimps)

    Thanks for reporting this.

    We’re fixing this in the next release.

    Best,
    CyberChimps Support

    I’m still getting this error with 3.16.4, on line 129:

    Notice: Undefined variable: responsive_options in /home/newmdbrands/public_html/wp-content/themes/responsive/header.php on line 129

    This was in the last version too.

    Thread Starter netpassprodsr

    (@netpassprodsr)

    I’m still getting this error with 3.16.4, on line 129:

    Notice: Undefined variable: responsive_options in /home/newmdbrands/public_html/wp-content/themes/responsive/header.php on line 129

    This was in the last version too.

    1. A proposed code patch to resolve this was already submitted.
    2. Something is preventing the data structure that appears to be fully initialized from reaching the line we both experience an error with.
    3. I hope to see the very next release of this theme include the patch I submitted so no one else experiences this error.

    This theme has been updated several times but the error persists.

    Depending on the version the error might appear on 129, 130 or 131
    Find the line directly before the error in header.php and change it:
    From:
    <? php
    to:
    <? php global $responsive_options;

    and the error goes away.

    Hopefully this shows up right and makes sense.

    Update 3.18 has the same issue.

    After seven weeks it seems to have been fixed in 3.19.

    Side note: I’m only using this theme to update an existing site developed by someone before me (who never created a child theme). I have never used this theme before, but the ugly breaking changes that seem to happen frequently with releases, despite using a child theme, is incredibly frustrating.

    • This reply was modified 4 years, 8 months ago by seoidau .

    Yep. It also still works in 3.20 although it reset my top menu/header background color. lol.

    Yes, hence my added rant about yet another significant change that we again have to get around, then discover IT’S INLINE STYLING!

    These were the first two I’ve ever noticed. *Shrug*

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘recent change to header.php generates errors in debug log’ is closed to new replies.