Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Division by Zero #9

Closed
HellPat opened this issue Nov 13, 2015 · 1 comment
Closed

Division by Zero #9

HellPat opened this issue Nov 13, 2015 · 1 comment

Comments

@HellPat
Copy link

HellPat commented Nov 13, 2015

If only one item and 1 tag exists, there is a division by zero error.

https://github.com/jadwigo/TaxonomyList/blob/master/Extension.php#L188

Maybe

$difference = $named['maxcount'] - $named['mincount'];
if($difference) {
   $row['weightpercent'] = ($row['count'] - $named['mincount']) / ($named['maxcount'] - $named['mincount']);
} else {
   $row['weightpercent'] = 0;
}
@jadwigo
Copy link
Owner

jadwigo commented Nov 13, 2015

nice catch - never encountered a site with only one item and tag

I'll look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants