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

Comments

Projects
None yet
2 participants
@virgofx
Copy link
Member

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

This comment has been minimized.

Copy link
Member Author

virgofx commented Feb 23, 2018

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

@virgofx

This comment has been minimized.

Copy link
Member Author

virgofx commented Mar 10, 2018

Confirmed fixed in 3.3.2

@sergeyklay

This comment has been minimized.

Copy link
Member

sergeyklay commented Mar 10, 2018

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

@sergeyklay sergeyklay closed this Mar 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.