Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete Model with SoftDelete Behavior Breaks with Mapped Properties and Snapshots #13302

Closed
virgofx opened this issue Feb 19, 2018 · 3 comments
Closed
Labels
bug A bug report status: medium Medium

Comments

@virgofx
Copy link
Contributor

virgofx commented Feb 19, 2018

Deleting a model that is using the SoftDelete trait with snapshots results in an error:

Column 'firstCamelCasedColumn' doesn't make part of the column map

The problem is with the columnMap parameters passed into the setSnapshotData() and setOldSnapshotData().

https://github.com/phalcon/cphalcon/blob/master/phalcon/mvc/model/behavior/softdelete.zep#L102-L103

model->setSnapshotData(updateModel->getSnapshotData(), columnMap);
model->setOldSnapshotData(updateModel->getOldSnapshotData(), columnMap);

Removing the columnMap from the second parameter fixes the issue. That would be the expected behavior as there is no need to re-translate keys after getting old data and then resetting. Otherwise, there is an issue somewhere in the setting of snapshots with column maps.

/cc @Jurigag

Details

  • Phalcon version: 3.3.1
  • PHP Version: PHP 7.1.14
  • Operating System: Ubuntu 16.04
  • Installation type: Package Manager
  • Server: Nginx
@virgofx virgofx changed the title SoftDelete Behavior Breaks with Mapped Properties and Snapshots Delete Model with SoftDelete Behavior Breaks with Mapped Properties and Snapshots Feb 19, 2018
@virgofx
Copy link
Contributor Author

virgofx commented Feb 23, 2018

@Jurigag Can you take a look and confirm the issue?

@virgofx
Copy link
Contributor Author

virgofx commented Mar 10, 2018

Confirmed fixed in 3.3.2

@sergeyklay
Copy link
Contributor

I apologize @virgofx for completely overlooking this. Thank you for the report, and for helping us make Phalcon better.

@niden niden added bug A bug report status: medium Medium and removed Bug - Medium labels Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: medium Medium
Projects
None yet
Development

No branches or pull requests

3 participants