Theme header broken on latest update

We had an issue with woo commerce not keeping the header/footer in tact on last update to 1.2.4 on Pro.

We needed to adjust the

From:
add_action( ‘x_late_template_redirect’, ‘x_bars_setup_modules’ );

To:
add_action( ‘template_redirect’, ‘x_bars_setup_modules’ );

I am not sure if this was because we went from X and upgraded to Pro.

Can you verify this?

wp-content/themes/pro/framework/functions/pro/bars/setup.php

Please let me know.

Thanks!

Hi there,

Thanks for writing in.

Does it have existing customization? You don’t need to edit the files directly, but I don’t understand the issue yet. But does it works when you adjusted it? Would you mind providing more details about the issue and how to reproduce this, then I’ll add this to our issue tracker for further checking?

Thanks!

Sure - I have a dev site set up for it

Bad:
add_action( ‘x_late_template_redirect’, ‘x_bars_setup_modules’ );

Good:
add_action( ‘template_redirect’, ‘x_bars_setup_modules’ );

Attached are the pages.

Does this help?

Hey there,

I could not replicate this with the updated X to Pro on my end so I’m not sure what could be causing this. Before we post this to our issue tracker, could you try the following:

  1. Ensure everything is up to date according to our version compatibility list at https://theme.co/apex/forum/t/troubleshooting-version-compatibility/195. Please follow the best practices when updating your theme and plugins. See https://theme.co/apex/forum/t/setup-updating-your-themes-and-plugins/62 for more details.

  2. Clear all caches including browser cache then deactivate your caching plugins and other optimization plugins.

  3. If you’re using a CDN, please clear the CDN’s cache and disable optimization services.

  4. Test for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

  5. Remove custom CSS, Javascript and templates.

  6. Contact your host to increase your allocated memory or do it yourself by adding this code in your wp-config.php

define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

Thanks.

Well - the theme upgraded and had the missing errors again in my woocommerce. I was able to fix it in the file above by adjusting this line:

//add_action( ‘x_late_template_redirect’, ‘x_bars_setup_modules’ );
add_action( ‘template_redirect’, ‘x_bars_setup_modules’ );

It is not the plugins or the memory as far as I can tell - we disabled all and adjusted memory - but when we upgraded - the problem still occurred.

Any idea?

Could you advise on any other changes you’ve made in your child theme or otherwise? Do you have anything modifying WP Query that you know of?

The late redirect hook was added to be more compatibility with plugins that modify the main WP query during template_redirect or template_include. Effectively our late hook runs during template_include which is the latest point to run something before PHP output begins.

It is only happening on Woocommerce pages - not any other pages. I am pretty sure the Woo commerce has wp_query set up. We are also running toolset - but we are not using it on these pages.

Any other info that can help? I appreciate your time on this.

Could you copy your site over to a staging server and give us access to it so we could check what’s causing the issue without affecting your live site?

Thanks.

Yes - Give me a few minutes - How do I get you the credentials privately?

Hi There,

Please double check FTP credentials. I am not able to login and check the file:

I was able to connect with the credentials I sent you. Can you make sure passive is off?

Hi there,

It’s because of the plugin Toolset WooCommerce Views, it may be overriding the Woocommerce template but not triggering the correct hooks as part of template standard. Deactivating it let the Woocommerce template have that hooks capability working again.

I left that plugin inactive so you may check it, but if you really wish to use that plugin then you may use it given that you’ll implement the workaround you provided above.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.