Issue a book from admin account
Describe the bug When I try to issue a book which as a quantity of 1 to a student from an admin account, I have a sql prepare exception:
SQLSTATE[42000]: Syntax error or access violation: 1064 Syntax error near ' 0), updated_at = ? where id in (?)' at line 1 (SQL: update books set quantity = MAX((quantity - 1), 0), updated_at = 2019-09-10 14:04:12 where id in (1))
But if I go to All issued books, I will see it as issued.
To Reproduce Steps to reproduce the behavior:
- Login as admin
- Issue a book
- Fill in form & submit
- See error
Expected behavior Be able to issue a book to a student
Additional context Code from master
PR is welcome but make sure the changes you make pass all the tests. To run tests please follow instructions in readme.
hi. i am also facinf same issue.
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' 0), books.updated_at= ? whereidin (?, ?)' at line 1 (SQL: updatebookssetquantity= MAX((quantity - 1), 0),books.updated_at= 2020-11-01 18:51:30 whereidin (5, 20))
in file
Unifiedtransform\vendor\laravel\framework\src\Illuminate\Database\Connection.php:671
earlier i was facing the same issue in a "Issuedbook.php" file
I just logged in with liberian account and add two books to issue.
@OzairKhanBro May be Max(quantity part is responsible for this. We need to take a look into it.