This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Possible Bug: Division by zero in class-asp-searchoverride.php

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Possible Bug: Division by zero in class-asp-searchoverride.php

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16069
    Yaniv Ozanayozana
    Participant

    Dear support team,
    It seems that there is a possible bug in the class-asp-searchoverride.php file:
    While typing some search phrases (but not all of them), I’ve got an error in my WAMP (localhost dev) the following:
    Division by zero in C:\wamp64\www\iglazer\wp-content\plugins\ajax-search-pro\includes\classes\filters\class-asp-searchoverride.php in line 91.

    It is important to mentioned that I am using two searches. they are one on top of the other. a javascript a swiching the visibilty between them, and as they look the same – it is unnoticeable.

    As a current workaround, i’ve modified the mentioned file, and added this line:
    $posts_per_page = $posts_per_page == 0 ? 1 : $posts_per_page;

    I would be happy to get a proper fix.

    Regards,
    Yaniv.

    #16080
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Thank you for letting us know.

    I’m not sure if this is a potential bug, as it may come from an incorrectly set option on the back-end. Can you please check if this option is not set to 0 on your back-end: https://i.imgur.com/dO9ayeU.png
    ..as well as the posts per page under the WordPress -> Reading settings is not set to 0 either: https://i.imgur.com/dOSJgaC.png
    If those are above 0, it should be fine. Nevertheless, I will add an additional check for zero division in the upcoming release, just to be sure.

    #16102
    Yaniv Ozanayozana
    Participant

    Hello,
    Thank you so much for your quick response.
    You were correct. the problem seems to be related to the fact that ‘Result count per page’ was empty.
    By setting the correct integer value, problem is resolved.

    Once again,
    Thank you!
    Best,
    Yaniv.

    #16108
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Possible Bug: Division by zero in class-asp-searchoverride.php’ is closed to new replies.