Wappler Version: Latest
Operating System: W10Pro latest
Server Model: NodeJS
Expected behaviour
This SC script is supposed to insert a product record in the database and update that record’s images field to contain all uploaded image’s file names:
The returned Identity value of the database insert (insert_product) action is expected to be an integer (product_id in this case, generated automatically since this field is an increments field for the products table).
Actual behavior
The returned Identity has value “INSERT”:
The condition for the add_images database update action returns an error because of that:
I wasn’t able to duplicate on a docker/node instance using mariadb. You might post some more details on your hosting environment and db in case they are the culprit.
Yes that could be a problem. Guess I used db update for the conditions tab, but going to try with a db insert action and the condition set inline in the insert options.
I am on NodeJS with Postgresql. But let me try the db inser instead of db update first, because if there's no value in the db field there's nothing to be updated indeed
It all works fine, except when the in the previous action inserted message’s identity is inserted into the messages column:
The error in the console then shows a similar error message as in the other case I posted here:
message: “insert into “support_tickets” (“messages”, “sender_email”, “sender_name”, “subject”) values ($1, $2, $3, $4, $5) - invalid input syntax for integer: “INSERT””
Unlike the previous case these are both db insert actions (where there was an db update action in the repeater in the other case). Anyone a clue?
Looks like some kind of regression as this was already reported and fixed a few updates ago. Either that or your json for the SC file is outdated/wrong.
{"status":"500","message":"returning is not defined","stack":"ReferenceError: returning is not defined\n at Builder.fromJSON (/Users/jon/Documents/dev/mpc-node/lib/core/db.js:77:50)\n at Function.knex.<computed> [as fromJSON] (/Users/jon/Documents/dev/mpc-node/node_modules/knex/lib/util/make-knex.js:259:30)\n at App.insert (/Users/jon/Documents/dev/mpc-node/lib/modules/dbupdater.js:14:33)\n at App._exec (/Users/jon/Documents/dev/mpc-node/lib/core/app.js:255:57)\n at App._exec (/Users/jon/Documents/dev/mpc-node/lib/core/app.js:234:28)\n at App.exec (/Users/jon/Documents/dev/mpc-node/lib/core/app.js:205:20)\n at App.condition (/Users/jon/Documents/dev/mpc-node/lib/modules/core.js:97:24)\n at App._exec (/Users/jon/Documents/dev/mpc-node/lib/core/app.js:255:57)\n at App._exec (/Users/jon/Documents/dev/mpc-node/lib/core/app.js:234:28)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)"