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

Prevent errors in getRandomNumber call on PHP 8.1 #127

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

Quazz
Copy link
Contributor

@Quazz Quazz commented Jun 7, 2022

It is now mandatory to pass an integer to the function; otherwise an error is thrown. This is due to changes in PHP 8 that removed using null as parameter in many php functions.

Currently if min is defined as null it will be passed as null, throwing an error.

Max is allowed to be null, however, since the Magento function will assign it a value if it's null.

I also assumed the original comparison of less than for max value was incorrect and changed it.

It is now mandatory to pass an integer to the function; otherwise an error is thrown.

Currently if min is defined as null it will be passed as null, throwing an error.

Max is allowed to be null, however.
@thomas-kl1
Copy link
Member

Good catch! thank you for your contribution!

@thomas-kl1 thomas-kl1 merged commit 970caf8 into opengento:master Jun 7, 2022
@thomas-kl1 thomas-kl1 self-assigned this Jun 7, 2022
@thomas-kl1 thomas-kl1 added the bug Something isn't working label Jun 7, 2022
@thomas-kl1 thomas-kl1 added this to In progress in Backlog via automation Jun 7, 2022
@thomas-kl1 thomas-kl1 added this to the Continous Enhancement milestone Jun 7, 2022
@thomas-kl1 thomas-kl1 moved this from In progress to Done in Backlog Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Backlog
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants