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

Star rating error after my update 7.4.3 #3433

Closed
mrtngrsbch opened this issue Sep 2, 2021 · 6 comments
Closed

Star rating error after my update 7.4.3 #3433

mrtngrsbch opened this issue Sep 2, 2021 · 6 comments
Assignees

Comments

@mrtngrsbch
Copy link

Hi,

I have upgraded to the latest version 7.4.3 and now I get an error when trying to save any page.

image

@mahagr
Copy link
Member

mahagr commented Sep 2, 2021

Which plugin are you using for star ratings?

@mahagr mahagr self-assigned this Sep 2, 2021
@mahagr mahagr transferred this issue from getgrav/grav-plugin-admin Sep 2, 2021
mahagr added a commit that referenced this issue Sep 2, 2021
@mahagr
Copy link
Member

mahagr commented Sep 2, 2021

7a1f553 should fix the issue.

@TheoAcker12
Copy link

This doesn't appear to be fully fixed. I didn't test all possible options, but with negative numbers, negative minimums, and high precision, number validation has issues. This is apparently because php's fmod function has issues (the code would be accurate if fmod were accurate).

An example failure is a value of -81.36802 with a minimum of -180 and step of .00001. Interestingly, a value of -81.26208 with the same parameters if perfectly fine, though if you up the step precision to .0000001 the situation reverses.

I'm going to use the previous code return !(isset($params['step']) && fmod($value - $min, $params['step']) === 0); for now, since that was working. Is there some issue with the previous code that required it to be changed?

@mrtngrsbch
Copy link
Author

mrtngrsbch commented Sep 2, 2021

Which plugin are you using for star ratings?

sorry for my delay
I don't have any stars plugin

@mahagr
Copy link
Member

mahagr commented Sep 2, 2021

Well, we do have integer check, let me try that one as fmod() seems to be broken beyond repair....

@mahagr
Copy link
Member

mahagr commented Sep 2, 2021

@TheoAcker12 Now it should work!

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

No branches or pull requests

3 participants