Tagged: Php error
-
AuthorPosts
-
August 30, 2021 at 3:31 pm #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:
WarningMessage:
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:2391How can this be fixed?
Thank you in advance!
September 1, 2021 at 4:17 am #1319267Hey 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,
IsmaelSeptember 1, 2021 at 6:19 pm #1319387Yes 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.
September 2, 2021 at 8:38 am #1319455Hi,
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,
IsmaelSeptember 2, 2021 at 2:50 pm #1319526Hi 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.September 4, 2021 at 4:24 am #1319700Hi,
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,
RikardSeptember 7, 2021 at 3:29 pm #1319992Thank you Rikard,
that’s what I’m waiting for – an update to see this in action.
Will keep you posted.September 9, 2021 at 4:36 am #1320175October 14, 2021 at 9:28 pm #1324998Hi 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?October 14, 2021 at 10:13 pm #1325006quick update. Your code was just used and it cleared the error immediately.
October 16, 2021 at 3:03 am #1325187Hi,
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,
IsmaelOctober 16, 2021 at 4:11 pm #1325237Hi!
I added the fix with wp_get_theme function to core for next release 4.8.7.
This should fix the problem.Cheers!
GünterOctober 19, 2021 at 6:35 pm #1325593Ismael – 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.
October 20, 2021 at 5:51 am #1325665 -
AuthorPosts
- You must be logged in to reply to this topic.