Skip to:
Content
Pages
Categories
Search
Top
Bottom

][Resolved] 0.1.9 – division by zero warning

  • Avatar of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    The My Media page is throwing a division by zero warning in 0.1.9:

    Warning: Division by zero in /home/inspired/public_html/sandbox/wp-content/plugins/bp_album_2010-06-26/includes/media/sub-media-classes.php on line 775

    Any thoughts?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of foxly
    foxly
    Participant

    @foxly

    @rogercoathup

    It likely means there is a mistake in our code somewhere. I don’t have the code open right now as I’m working on something else, but from memory…

    The error is probably being caused because $pictures_template->???->pag_per_page is not being set. The value for that should be in $bp->bpa->options. The value for that should come from the options variable BP Album+ sets in the site options. The value it uses comes from the admin screen with the option that sets how many items to display per page. It is also set in the admin default options file… sub-admin-defaults(?).php.

    So if the option is not set, PHP returns 0 for the result. Then the class uses it in the division operation on line 775 causing the div by zero error.

    I’ll chase it down later tonight when I’ve got some free time.

    Thanks!

    ^F^

    Avatar of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    Cheers, thanks for the quick response

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.