Tagged: 

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1318985

    Hi guys,
    this is not urgent, but this is a persistent issue that I was hoping you could help me sort out. Every time we do a theme update, we have the same php error pop up.

    Here’s the warning that the query monitor shows:
    Level:
    Warning

    Message:
    Use of undefined constant THEMENAME – assumed ‘THEMENAME’ (this will throw an Error in a future version of PHP)

    Location:
    wp-content/themes/enfold/functions-enfold.php:2222
    avia_mailchimp_widget->__construct()
    wp-includes/class-wp-widget-factory.php:61
    WP_Widget_Factory->register()
    wp-includes/widgets.php:115
    register_widget()
    wp-content/themes/enfold/functions-enfold.php:2391

    How can this be fixed?

    Thank you in advance!

    #1319267

    Hey Lana,

    Thank you for the inquiry.

    Do you update the theme in the dasboard (Enfold > Theme Updates)? Try to edit the enfold/functions-enfold.php, look for the avia_mailchimp_widget function and this code around line 2219:

    
    		function __construct() {
    			//Constructor
    			$widget_ops = array('classname' => 'avia_mailchimp_widget', 'description' => 'A widget that displays a Mailchimp newsletter signup form' );
    			parent::__construct( 'avia_mailchimp_widget', THEMENAME.' Mailchimp Newsletter Signup', $widget_ops );
    		}
    

    Replace it temporarily with:

    	function __construct() {
    			$theme = wp_get_theme();
    
    			//Constructor
    			$widget_ops = array('classname' => 'avia_mailchimp_widget', 'description' => 'A widget that displays a Mailchimp newsletter signup form' );
    			parent::__construct( 'avia_mailchimp_widget', $theme->name.' Mailchimp Newsletter Signup', $widget_ops );
    		}
    

    Let us know if the error still occurs.

    Best regards,
    Ismael

    #1319387

    Yes we update the theme with a token. This is what is shows now:
    ————-
    Theme Updates
    No Updates available. You are running the latest version! (4.8.6.2)
    ————-

    Thank you for the code Ismael – I’m not sure I will see the difference that it would make until the next update because our guys had already addressed the php error. We’ve done it several times with several latest updates at this point. So we’ll use the code you provided and I will let you know if it addresses the issue once there is another update released.

    This morning, we had a new error pop up. I haven’t seen this one before:
    —————–
    Missing Dependencies
    avia_template_save_js
    wp-content/themes/enfold/config-templatebuilder/avia-template-builder/assets/js/avia-template-saving.js
    avia_element_js (missing)
    —————–

    Any ideas on this new one?

    Thank you guys. I love the theme, it’s hands down the best we’ve ever worked with.

    #1319455

    Hi,

    Do you see this warning when you are using the Advance Layout Builder (ALB)? This warning may occur on other dashboard panels because the avia-template-saving.js file only loads when ALB is active. This is nothing critical, so it should not affect how the theme or how the site in general works.

    Glad to know that you are enjoying the theme. And thank you for your patience.

    Best regards,
    Ismael

    #1319526

    Hi Ismael,
    no warnings of that kind at all.
    Yesterday when we implemented the code you provided we experienced a temp delay in mandrill delivery (several hours) but then it all sorted itself out and seems to be working now just fine. I still do not know if it removed the php error since there were no theme updates performed. Just an FYI.

    #1319700

    Hi,

    Thanks for the update. We’ll keep this thread open for you, in case you should have similar problems with the next theme update.

    Best regards,
    Rikard

    #1319992

    Thank you Rikard,
    that’s what I’m waiting for – an update to see this in action.
    Will keep you posted.

    #1320175

    Hi,

    Great, we’ll keep this thread open for you.

    Best regards,
    Rikard

    #1324998

    Hi guys, just updated the theme to the latest and the same php error is back.
    I can attempt to implement the code you provided again but now that we know that it is only until the next update any ideas on a permanent fix?

    #1325006

    quick update. Your code was just used and it cleared the error immediately.

    #1325187

    Hi,

    Thanks for the update.

    We will forward the issue to our channel. We might have to refrain from using the THEMENAME constant in the avia_mailchimp_widget function and use the wp_get_theme function instead as suggested previously.

    How do you update the theme? Is it working correctly when the plugins are disabled?

    Best regards,
    Ismael

    #1325237

    Hi!

    I added the fix with wp_get_theme function to core for next release 4.8.7.
    This should fix the problem.

    Cheers!
    Günter

    #1325593

    Ismael – everything works fine even with that error or at least on the user end there are not major issues. We update via the token directly on the website when updates are available.

    Günter – thank you I’ll update this thread after the next update is performed.

    #1325665

    Hi Lana,

    Thanks for the update. Please let us know here if you should have any further problems with the next update.

    Best regards,
    Rikard

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.