Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #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.12

    #1262682

    Hey 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,
    Nikko

    #1262736

    PHP 7.4 as a major release has been around since November 2019.

    Also, PHP 7.4 is the recommended version for WordPress.

    #1262779

    Hi perfectword,

    Is it notice or a warning?

    Best regards,
    Victoria

    #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

    #1263061

    Hi 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,
    Victoria

    #1263134

    Line 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!

    #1263951

    Hi,

    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,
    Ismael

    #1264032

    Thank 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.

    #1264271

    Hi!

    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,
    Ismael

    #1264295

    That 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!

    #1264840

    Hi 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

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