Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #1313524

    Hi.

    When I upgrade one particular website to later versions of Enfold, specific pages will not load, and an email is sent from WordPress to inform there has been a critical error.

    That error message is:

    Since WordPress 5.2 there is a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.

    In this case, WordPress caught an error with your theme, Enfold.

    First, visit your website (https://www.specialneedsrespite.com.au/) and check for any visible issues. Next, visit the page where the error was caught (https://www.specialneedsrespite.com.au/wp-admin/admin-ajax.php) and check for any visible issues.

    *Note: The pages that cause the error are only those that are using the WooCommerce Product Grid Element. eg: https://www.specialneedsrespite.com.au/find-a-carer-or-nurse/carers-nurses-act/. And it is only later versions of Enfold. This has happened since the move from 4.7.6.4 to 4.8 versions.

    Regards
    Iain Kennedy

    #1313557

    If I remove the “Product Grid” element, and replace it with a “Code Block” with this code, it works.

    [product_category category=”Queensland” per_page=”12″ columns=”3″]

    You can see an example of that at https://www.specialneedsrespite.com.au/find-a-carer-or-nurse/find-carers-nurses-qld/

    But I don’t want to edit each page and replace them all.
    I want to use the “Product Grid” element.

    **EDIT
    Pages still don’t load with v4.86

    #1314036

    Hi Iain,

    Sorry for the late reply. Could you enable debug mode, so that we can try to copy your content to a test page or test installation please? https://kriesi.at/documentation/enfold/intro-to-advanced-layout-builder/#debug-mode. We can do it for you if you give us permission to do so. Also please make sure that Appearance->Theme Editor is active on your installation. If not, then please include FTP login details as well.

    Best regards,
    Rikard

    #1314041

    I have enabled both the debug mode and the Theme Editor function.

    Regards
    Iain

    #1314332

    Hi,

    Thanks for that. I created a test page, please see private. I got the same problem there, but I couldn’t reproduce the problem on a local installation. I tried activating the parent theme on your site as well, and it’s working as it should after that. Could you try to remove all your customisation, then add them back one to one to see which one is causing this problem please?

    Best regards,
    Rikard

    #1314493

    I removed all Custom CSS and saved.
    Then I added the Product Grid element to https://www.specialneedsrespite.com.au/find-a-carer-or-nurse/find-carers-nurses-qld/ and configured it for the product category and number of columns.
    When I saved the page, I received the error:

    There has been a critical error on this website. Please check your site admin email inbox for instructions.

    The email sent is the same as before.

    That error message is:

    Since WordPress 5.2 there is a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.

    In this case, WordPress caught an error with your theme, Enfold.

    First, visit your website (https://www.specialneedsrespite.com.au/) and check for any visible issues. Next, visit the page where the error was caught (https://www.specialneedsrespite.com.au/wp-admin/admin-ajax.php) and check for any visible issues.

    I have not re-added the Custom CSS yet.

    **Note. There is a functions.php file in the Child Theme that contains the following:

    /*
    * Add your own functions here. You can also copy some of the theme functions into this file.
    * WordPress will use those functions instead of the original functions then.
    */

    add_filter(‘woocommerce_get_availability’, ‘availability_filter_func’);
    function availability_filter_func($availability)
    {
    $availability[‘availability’] = str_ireplace(‘Out of stock’, ‘This Nurse/Carer is currently unavailable’, $availability[‘availability’]);
    return $availability;
    }

    function cw_change_product_price_display( $price ) {
    $price .= ‘ to access this Nurse/Carer’;
    return $price;
    }
    add_filter( ‘woocommerce_get_price_html’, ‘cw_change_product_price_display’ );
    add_filter( ‘woocommerce_cart_item_price’, ‘cw_change_product_price_display’ );

    /**
    * Change the heading title on the “Product Description” tab section for single products.
    */
    add_filter( ‘woocommerce_product_description_heading’, ‘isa_product_description_heading’ );

    function isa_product_description_heading() {
    return ‘Qualifications/Experience’;
    }

    /**
    * Change the Description tab link text for single products
    */
    add_filter( ‘woocommerce_product_description_tab_title’, ‘isa_wc_description_tab_link_text’, 999, 2 );

    function isa_wc_description_tab_link_text( $text, $tab_key ) {

    return esc_html( ‘About’ );

    }add_action( ‘woocommerce_no_products_found’, function(){
    remove_action( ‘woocommerce_no_products_found’, ‘wc_no_products_found’, 10 );

    // HERE change your message below
    $message = __( ‘No Carers or Nurses available.’, ‘woocommerce’ );

    echo ‘<p class=”woocommerce-info”>’ . $message .'</p>’;
    }, 9 );

    remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’ );
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_add_to_cart’, 30 );
    remove_action( ‘woocommerce_after_single_product_summary’, ‘avia_woocommerce_output_related_products’, 20);
    remove_action( ‘woocommerce_after_single_product_summary’, ‘avia_woocommerce_output_upsells’, 21);
    remove_action( ‘woocommerce_after_single_product_summary’, ‘avia_woocommerce_display_output_upsells’, 30);

    add_filter(‘avia_load_shortcodes’, ‘avia_include_shortcode_template’, 15, 1);
    function avia_include_shortcode_template($paths)
    {
    $template_url = get_stylesheet_directory();
    array_unshift($paths, $template_url.’/shortcodes/’);

    return $paths;
    }

    Regards
    Iain

    #1314837

    Hi Iain,

    CSS code doesn’t throw server errors. You need to remove the content from functions.php and productslider.php in your child theme. You can start off by removing productslider.php, and empty the content from functions.php. After that you can add each function back one by one into functions.php, and check what happens after each function is added back. After that you can copy the content of productslider.php from the parent theme, then add your customisations back in, to see what happens after that.

    Best regards,
    Rikard

    #1314916

    Hi Rickard.

    So just to recap.

    Everything works just fine with the customizations I have used with all the latest updated Plug-in’s and the latest WordPress version when using Enfold v4.7.6.4

    When I upgrade to Enfold versions 4.8x, using the “Product Grid” element causes an error on pages that use that element.

    If I replace that element with a “Code Block” and insert a shortcode that effectively does the same thing as the “Product Grid” element, those pages load and display just fine.

    It would seem to me that the issue is not with the customizations, but rather this particular element in the 4.8x versions of the Enfold Theme.
    Is that a fair assessment?

    Regards
    Iain

    #1315106

    Hi Iain,

    It would seem to me that the issue is not with the customizations, but rather this particular element in the 4.8x versions of the Enfold Theme.
    Is that a fair assessment?

    If this was a general problem with the element in question yes, but the element works fine when I try it on a test installation. It works as it should when your customisations are removed as well, and we’ve had no other users report the same problem. Could you try to do what I recommended above please?

    Best regards,
    Rikard

    #1315108

    Thanks for all the assistance Rickard, but I just went ahead and removed the Product Grid element from all pages and replaced it with the Code Block element with the short code instead.

    I have no doubt that removing the code from the functions.php would most likely have resulted in the pages loading, but I needed to keep those customizations.

    You may close this thread now if you wish.

    Regards
    Iain

    #1315219

    Hi Iain,

    Thanks for the update. I’m not so sure that functions.php is the problem with you site, it’s likely that the override you are doing on productslider.php is causing this problem. Do you know what exactly you are overriding in that file? We could try try delete it for you via FTP, we’ll keep a copy of the file locally, in case you would want it put back. If you don’t want to do this on your live site, then you can try to copy the site to a staging area, and we’ll try it out there instead.

    Best regards,
    Rikard

    #1315221

    I’ll take a look at the productslider.php file and see what I find.

    Regards
    Iain

    • This reply was modified 3 years, 4 months ago by spottydog63.
    #1315226

    OK, I don’t know why that productslider.php file is there.
    I can’t see anywhere where a Product Slider is used.
    So I renamed the folder it is in to shortcodes.bak and renamed productslider.php to productslider.php.bak and then tested the page that you created and it works.

    I will now go and change the other pages back to using the Product Grid element.

    Thanks very much for persisting with this.

    Regards
    Iain

    #1315940

    Hi Iain,

    Great, I’m glad that you got things working, and thanks for the update. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #1315946

    Hi Rickard.

    Yes, you can close this topic.

    Regards
    Iain

    #1316192

    Hi,

    Thanks for the update, I’ll go ahead and close this thread for now then. Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘Upgrading to later version of Enfold causes critical error’ is closed to new replies.