Skip to content

PDOException: SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value:  #169

@strtob

Description

@strtob

Hi folks,

I have the tables with has many relations:

  • company
  • company_has_role
  • company_role

I've used gii enhanced to generate tables and gui with softdelete, time and userstamp.

Now, I've started to develop the update in modal view and update with ajax call.

I've dumped the model before saveAll() in the controller, model seems to be loaded correctly, but I get the following error:

Next yii\db\Exception: SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: '' The SQL being executed was: UPDATE tbl_company_has_roleSETdeleted_by=1, deleted_at='2021-05-02 02:27:56' WHERE (tbl_company_id='1') AND (id<>'') in /vendor/yiisoft/yii2/db/Schema.php:678

If I submit the ajax button without new hasmanyentries (just the master table company), the system save the data in the correct form. When I add data into the has many forms, I've got an error which pointed at vendor/mootensai/yii2-relation-trait/RelationTrait.php(228): yii\db\ActiveRecord::updateAll()

I have no idea how to fix?

Thanks in advance!
Toby

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions