Server 500 error: TypeError: rule.value.replace is not a function
How to reproduce
Detail a step by step guide to reproduce the issue
Before the 6.8.0. update it worked fine considering the split function.
It used to work without any problem, in fact the online version that I haven't updated works like that.
Now I got this:
"TypeError: rule.value.replace is not a function\n at QueryBuilder_MySQL.whereGroup (/Users/agmichaca/Developments/auto2024/lib/core/db.js:57:47)\n at QueryBuilder_MySQL.fromJSON (/Users/agmichaca/Developments/auto2024/lib/core/db.js:181:14)\n at QueryBuilder_MySQL.<anonymous> (/Users/agmichaca/Developments/auto2024/lib/core/db.js:78:18)\n at compileCallback (/Users/agmichaca/Developments/auto2024/node_modules/knex/lib/formatter/formatterUtils.js:7:12)\n at wrap (/Users/agmichaca/Developments/auto2024/node_modules/knex/lib/formatter/wrappingFormatter.js:85:9)\n at get tableName [as tableName] (/Users/agmichaca/Developments/auto2024/node_modules/knex/lib/query/querycompiler.js:1472:11)\n at QueryCompiler_MySQL.onlyJson (/Users/agmichaca/Developments/auto2024/node_modules/knex/lib/query/querycompiler.js:800:13)\n at QueryCompiler_MySQL.columns (/Users/agmichaca/Developments/auto2024/node_modules/knex/lib/query/querycompiler.js:313:25)\n at /Users/agmichaca/Developments/auto2024/node_modules/knex/lib/query/querycompiler.js:135:40\n at Array.forEach (<anonymous>)\n at QueryCompiler_MySQL.select (/Users/agmichaca/Developments/auto2024/node_modules/knex/lib/query/querycompiler.js:134:16)\n at QueryCompiler_MySQL.toSQL (/Users/agmichaca/Developments/auto2024/node_modules/knex/lib/query/querycompiler.js:75:29)\n at QueryBuilder_MySQL.toSQL (/Users/agmichaca/Developments/auto2024/node_modules/knex/lib/query/querybuilder.js:84:44)\n at ensureConnectionCallback (/Users/agmichaca/Developments/auto2024/node_modules/knex/lib/execution/internal/ensure-connection-callback.js:4:30)\n at Runner.ensureConnection (/Users/agmichaca/Developments/auto2024/node_modules/knex/lib/execution/runner.js:318:20)\n at async Runner.run (/Users/agmichaca/Developments/auto2024/node_modules/knex/lib/execution/runner.js:30:19)"
If I removed the Split function works, but only with one word.
May not be of relevance but what MySQL driver are you running locally? And what version is on the remote host?
Also a quick search produces this result that may be of interest?
The "TypeError: replace is not a function" error occurs when we call the replace() method on a value that is not of type string.
To solve the error, convert the value to a string, or check if the value is of type string before calling the replace() method.
The reason I asked about the MySQL driver is there are some changes with the newer driver. In your connection settings do you have the depreciated driver set remotely out of interest? This will show in your Target settings. Again can you see if this matches your local configuration? ie is it the depreciated driver running locally or not..?
If it's an undefined value then some Wappler change made the split formatter stop working with undefined (or null) values
You could test this by adding the .default formatter before the split, but if you confirm this then it's best the Wappler team to fix this as it's a breaking behaviour
Know that contains and in do something completely different.
contains looks if a string is part of the data in the column, like when q is " hello" it will match when the column would have "hello world" as data.
in looks if the data of the column is within the collection you supply, like when q is ["hello", "world"] it will not match "hello world" but will match "hello" or "world" as column data, the data must exactly match.