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

Fix encoding arrays for (NOT) IN queries #10

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

JulianVennen
Copy link
Member

When trying to use a where condition, using IN or NOT IN and passing an array, the following Fatal Error occurs:

PHP Fatal error:  Uncaught TypeError: Aternos\Model\Query\Generator\SQL::generateValue(): Argument #1 ($value) must be of type string|int|float|null, array given, called in vendor/aternos/model/src/Query/Generator/SQL.php on line 127 and defined in vendor/aternos/model/src/Query/Generator/SQL.php:267
Stack trace:
#0 vendor/aternos/model/src/Query/Generator/SQL.php(127): Aternos\Model\Query\Generator\SQL->generateValue()
#1 vendor/aternos/model/src/Query/Generator/SQL.php(145): Aternos\Model\Query\Generator\SQL->generateWhere()
#2 vendor/aternos/model/src/Query/Generator/SQL.php(88): Aternos\Model\Query\Generator\SQL->generateWhere()
#3 vendor/aternos/model/src/Driver/Mysqli/Mysqli.php(240): Aternos\Model\Query\Generator\SQL->generate()
#4 vendor/aternos/model/src/GenericModel.php(469): Aternos\Model\Driver\Mysqli\Mysqli->query()

This PR fixes that issue by generating the correct SQL representation of the array

@matthi4s matthi4s merged commit 882e03c into aternosorg:master Jul 15, 2024
3 checks passed
@JulianVennen JulianVennen deleted the fix-in-queries branch July 15, 2024 14:12
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

Successfully merging this pull request may close these issues.

2 participants