Wappler Version : 5.1.5 (Pro)
Operating System : Windows 10 64 bits / Linux
Server Model: Apache / PHP 8.0.x / gnix / windows
Database Type: MySql 8 - InnoDB
Hosting Type: Developement
Hello,
This is happening in the Server Side Components.
I use a lot of custom tables (dynamic names) and I can’t update a field in Tagify format with a “Database Custom Query” component.
Everything works fine with “Database Update Component”
With a lot of perseverance, I found a temporary solution to my problem following a direct insertion (in the Custom Query component) attempt giving a “Cannot read properties of undefined (reading 'forEach)” error…
Add square brackets in the MySql query as follows:
Not sure what you are posting for category, is it an array?
You can try {{$_POST.category.toJSON()}} as expression. The problem with the custom query is that we don’t know what value is expected in the column, with the normal update we have the schema information from the database which we use to determine if we need to convert the value first. Like with the category which is a json field, the driver doesn’t support arrays as value and we need to do the json serialize before passing the value.
The custom query probably will need to be updated to allow you setting the type of the parameter so that we can convert them correctly for the database.