Service update throw error

System Information
  • Strapi Version: 4.4.1
  • Operating System: Windows 10
  • Database: MySQL
  • Node Version: 16.10.0

Hi everyone !

In my plugin, I have this lifecycle

module.exports = {
    beforeUpdate: async (event) => {  
        try {
            await strapi
            .service("plugin::todo.task")
            .update(1, { data: { default: false } });
        } catch (e) {
        console.log("error", e);
        }
    },
};

But when it is executed, I’ve thie error in the console

error Error: Undefined binding(s) detected when compiling WHERE. Undefined column(s): [t2.id] query: where `t0`.`id` <> ? and `t0`.`default` = ? and `t2`.`id` = ?

    at QueryCompiler_MySQL.toSQL (D:\app\backend\node_modules\knex\lib\query\querycompiler.js:110:13)

    at compileCallback (D:\app\backend\node_modules\knex\lib\formatter\formatterUtils.js:13:19)

pp\backend\node_modules\knex\lib\query\querycompiler.js:1ules\knex\lib\formatter\wrappingFormatter.js:225:7)32:16)                                                   khundapp\backend\node_modules\knex\lib\query\querycompiler.js:1084:17)    

    at QueryCompiler_MySQL.toSQL (D:\app\backend\node_modules\knex\lib\query\querycompiler.js:573:34)p\backend\node_modules\knex\lib\query\querycompiler.js:73\lib\query\querycompiler.js:133:40:29)

    at Builder.toSQL (D:\app\backend\nopp\backend\node_modules\knex\lib\query\querycompiler.js:132:16)de_modules\knex\lib\query\querybuilder.js:83:44)

I’ve tried this :

await strapi.entityService.update("plugin::todo.task", 1, {
    data: {
          default: false,
    },
});

But same error

So, what’s wrong whith the update service ?

Having the same problem. Any suggestions?