Unifiedtransform icon indicating copy to clipboard operation
Unifiedtransform copied to clipboard

Issue a book from admin account

Open floviolleau opened this issue 4 years ago • 3 comments

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:

  1. Login as admin
  2. Issue a book
  3. Fill in form & submit
  4. See error

Expected behavior Be able to issue a book to a student

Additional context Code from master

floviolleau avatar Sep 10 '19 12:09 floviolleau

PR is welcome but make sure the changes you make pass all the tests. To run tests please follow instructions in readme.

changeweb avatar Sep 14 '19 05:09 changeweb

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 avatar Nov 01 '20 17:11 OzairKhanBro

@OzairKhanBro May be Max(quantity part is responsible for this. We need to take a look into it.

changeweb avatar Nov 02 '20 13:11 changeweb