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

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 6 years, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16069
    Yaniv Ozana
    yozana
    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.

    Attachments:
    You must be logged in to view attached files.
    #16080
    Ernest Marcinko
    Ernest 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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #16102
    Yaniv Ozana
    yozana
    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 Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


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.