PHP Error – Undefined Index ? - by Jimbo

This topic has 7 replies, 3 voices, and was last updated 7 years ago ago by Rose Tyler

  • Avatar: Jimbo
    Jimbo
    Participant
    February 17, 2017 at 17:53

    Hi guys,

    I noticed an error in my debug logs, please see below;

    [17-Feb-2017 16:45:07 UTC] PHP Notice: Undefined index: in /home/FOLDER/public_html/example.co.uk/wp-content/themes/woopress/framework/theme-functions.php on line 547

    This relates to this section within the themes-functions.php file below;

     if( ! empty($google_font[0])) {
                $font[] = "font-family: " . $gfonts[$google_font[0]['family']]['family'] . ";";
              } else if ( ! empty( $value['font-family'] ) ) {
                foreach ( et_recognized_font_families( '' ) as $key => $v ) {
                  if ( $key == $value['font-family'] ) {
                    $font[] = "font-family: " . $v . ";";
                  }
                }
              }

    How can this be fixed please?

    Thank you

    6 Answers
    Avatar: Jimbo
    Jimbo
    Participant
    February 18, 2017 at 15:01

    I also have this error from my debug.log below, relates to the etheme_portfolio and essiential grid and is causing issues with syntax errors.

    WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
    			AND wp_posts.post_status = 'publish'
    			AND wp_posts.post_type = 'e' at line 5 for query SELECT ID, post_name, post_type FROM wp_posts
    			LEFT JOIN wp_term_relationships ON(wp_posts.ID = wp_term_relationships.object_id)
    			LEFT JOIN wp_term_taxonomy ON(wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id)
    			LEFT JOIN wp_terms ON(wp_term_taxonomy.term_id = wp_terms.term_id)
    			WHERE wp_terms.name  NOT IN ()
    			AND wp_posts.post_status = 'publish'
    			AND wp_posts.post_type = 'etheme_portfolio'

    and

    WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
    			AND wp_posts.post_status = 'publish'
    			AND wp_posts.post_type = 'e' at line 5 for query SELECT ID, post_name, post_type FROM wp_posts
    			LEFT JOIN wp_term_relationships ON(wp_posts.ID = wp_term_relationships.object_id)
    			LEFT JOIN wp_term_taxonomy ON(wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id)
    			LEFT JOIN wp_terms ON(wp_term_taxonomy.term_id = wp_terms.term_id)
    			WHERE wp_terms.name  NOT IN ()
    			AND wp_posts.post_status = 'publish'
    			AND wp_posts.post_type = 'essential_grid'

    I don’t use the portfolio or essiential grid for anything, can these calls be removed?

    Thank you

    Avatar: Jimbo
    Jimbo
    Participant
    February 18, 2017 at 16:32

    I now think this calls from portfolio.php and originates from innit.php inside the framework.

    As I have said I don’t use the portfolio feature and don’t use the testimonials as I use a separate plugin for testimonials.

    What is the best way of removing the portfolio requests to resolve my issue, also if I can remove the testimonials that would be good.

    Thanks

    Avatar: Jimbo
    Jimbo
    Participant
    February 20, 2017 at 19:20

    I have resolved this issue #155162 for now

    Unsure if it was the correct way to resolve but I’ve commented out the loading of portfolio & essential grid from the init.php file, also deactivated the essential grid plugin.

    There is a clearly an error in the themes coding causing this so still worth the developers looking at the code.

    Still have an issue with #155120 at the start of this topic, google fonts.

    I HAVE BEEN TOLD OLGA IS GOING TO RESPOND TO MY POSTS AS NO ONE ELSE FROM SUPPORT IS BOTHERING!

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    March 1, 2017 at 08:57

    Hello,

    Sorry for the delay in answering.
    We this issue will be fixed in next theme update, here is correct code http://prnt.sc/eejvzm

    DB issue – What version of the My SQL do you use?

    Regards

    Avatar: Jimbo
    Jimbo
    Participant
    March 4, 2017 at 00:27

    Hi,

    My SQL version is v5.6.34

    I will add the code change you suggested, thanks Olga

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 20, 2017 at 10:18

    Hello,

    We’ve checked and don’t have this error in our theme. Please check your plugins and update all of them to the latest versions.
    Please check if the problem persists with default Woocommerce theme Storefront because we haven’t such request to db in our theme.

    Regards,
    Rose Tyler.

  • Viewing 7 results - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.