Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix errors when using provided exists() code for SoftDelete #68

Merged
merged 1 commit into from

2 participants

@cincodenada

Both the original exists() and SoftDelete explicitly check and account for $id being null, so there shouldn't be any issues with providing the default.

@cincodenada cincodenada Add a default value to the provided exists() code
If there is no default value, errors are thrown when code expecting to use the original exists() use it without a value.
f113eab
@dogmatic69 dogmatic69 merged commit 1490dde into CakeDC:2.0-tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 7, 2013
  1. @cincodenada

    Add a default value to the provided exists() code

    cincodenada authored
    If there is no default value, errors are thrown when code expecting to use the original exists() use it without a value.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  readme.md
View
2  readme.md
@@ -77,7 +77,7 @@ The SoftDelete behavior allows you to keep records on database and do not show t
Since "exists" method in Model disable callbacks you may experience problems using it. To avoid these problems you can use the "existsAndNotDeleted" method from the behavior and we provide the following code to be put into AppModel to make this transparent:
- public function exists($id) {
+ public function exists($id = null) {
if ($this->Behaviors->attached('SoftDelete')) {
return $this->existsAndNotDeleted($id);
} else {
Something went wrong with that request. Please try again.