-
AuthorPosts
-
November 24, 2020 at 12:59 am #1262553
Howdy!
My error_log is filled with these:
A non-numeric value encountered in themes/enfold/config-templatebuilder/avia-shortcodes/slideshow_layerslider/slideshow_layerslider.php on line 146
Any assistance would be appreciated. Thanks!
WP 5.5.3
Enfold 4.7.6.3
PHP 7.4.12November 24, 2020 at 2:47 pm #1262682Hey perfectword,
Can you try to downgrade your PHP version to 7.3?
Enfold 4.7.6.3 was released August 15th this year while PHP 7.4.12 was released in Oct. 29 this year, maybe there’s some incompatibility with it.Best regards,
NikkoNovember 24, 2020 at 4:30 pm #1262736PHP 7.4 as a major release has been around since November 2019.
Also, PHP 7.4 is the recommended version for WordPress.
November 24, 2020 at 6:55 pm #1262779Hi perfectword,
Is it notice or a warning?
Best regards,
VictoriaNovember 24, 2020 at 7:35 pm #1262792[24-Nov-2020 16:52:31 UTC] PHP Warning: A non-numeric value encountered in /home/user/domain/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/slideshow_layerslider/slideshow_layerslider.php on line 146
November 25, 2020 at 7:17 pm #1263061Hi perfectword,
You can set the error level reporting to be for errors only, and so this warning will not be spamming your log.
Here is an article for you:
Best regards,
VictoriaNovember 25, 2020 at 11:55 pm #1263134Line 146 of /home/user/domain/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/slideshow_layerslider/slideshow_layerslider.php is
$params['style'] = " style='height: " . ( $height + 1 ) . "px;' ";
So, no one wants to venture a guess as to what is causing the php error “A non-numeric value encountered”? Might the error be caused by something we have programmed incorrectly into our slider? Is it something systemically wrong with Enfold coding in this file?
Should the error not be fixed or addressed, rather than ignored?
Thanks!
November 30, 2020 at 1:08 pm #1263951Hi,
What is the value of the $height variable? It is possible that the height value contains the measurement unit px or the value is in string format, which is why it throws the notice or error. Try to use the intval function to make sure that the actual integer value is extracted from the variable.
// https://www.php.net/manual/en/function.intval.php
Example:
intval($height) + 1
Best regards,
IsmaelNovember 30, 2020 at 5:18 pm #1264032Thank you, Ismael.
Are you suggesting I edit slideshow_layerslider.php ?
I looked at the height as set in wp-admin/admin.php?page=layerslider&action=edit&id=2#slider-settings > Canvas Height
I only have whole numbers set there. No units of measurement.
December 1, 2020 at 4:29 pm #1264271Hi!
Are you suggesting I edit slideshow_layerslider.php ?
Yes, you have to dump the value of the $height variable to check it, or add a breakpoint to the line if you are using any debugging extension in your code editor. The format of the value there might be different compare to the value in the settings panel.
// https://www.geeksforgeeks.org/php-var_dump-function/
Did you try the suggested modification above?
Best regards,
IsmaelDecember 1, 2020 at 6:07 pm #1264295That appears to have worked.
I deleted the error_log, made the suggested change in slideshow_layerslider.php, cleared my browser cache, accessed the site on desktop and mobile. No new error_log was created.
Will this be fixed in a future version of Enfold?
Thanks for the help!
December 3, 2020 at 7:39 pm #1264840Hi perfectword,
Glad you got it working for you! :)
Yes, the issue will be fixed.
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.