Skip to content

Illegal offset type in idiorm.php on line 2028 #233

@chihlongliu-zz

Description

@chihlongliu-zz

When using compound keys with id_column_overrides, I get some illegal offset type warnings with PHP 5.3.3. On line 2026, taking the array slice of the column still results in an array (with the single element that was sliced out from $column). Using $column[0] = $column seems to fix this problem.

However, when I run it, $db->lastInsertId() is undefined, and even if I hard code $this->_data[$column] to a set value (e.g. 30), saving it won't set the id value to 30. (actually, if creating a new record in this context, the database autoincrements the value correctly, so I'm not sure if lastInsertId() is even needed)

Lastly, I also ran into the illegal offset type problem on line 1892 (under _get_id_column_name()). The current workaround I found was to explicitly define in id_column_overrides all id columns for all tables, even if the table only had a single primary key with name 'id'.

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