Skip to content

Commit

Permalink
Fix deprecated call of setDirty()
Browse files Browse the repository at this point in the history
  • Loading branch information
raul338 committed Apr 24, 2018
1 parent ff684ab commit 66b7630
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Model/Behavior/UploadBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function beforeSave(Event $event, Entity $entity, ArrayObject $options)
if (Hash::get((array)$entity->get($field), 'error') !== UPLOAD_ERR_OK) {
if (Hash::get($settings, 'restoreValueOnFailure', true)) {
$entity->set($field, $entity->getOriginal($field));
$entity->dirty($field, false);
$entity->setDirty($field, false);
}
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Model/Behavior/UploadBehaviorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public function testBeforeSaveUploadError()
->method('set')
->with('field', $originalValue);
$this->entity->expects($this->once())
->method('dirty')
->method('setDirty')
->with('field', false);
$this->assertNull($behavior->beforeSave(new Event('fake.event'), $this->entity, new ArrayObject));
}
Expand Down

0 comments on commit 66b7630

Please sign in to comment.