Skip to content

Commit

Permalink
lock() now returns false when no data was found [#74 state:resolved]
Browse files Browse the repository at this point in the history
  • Loading branch information
ceeram committed Jan 6, 2010
1 parent 0f80285 commit fcd9bb4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion infinitas/core/models/behaviors/lockable.php
Expand Up @@ -49,7 +49,9 @@ function setup(&$Model, $config = null) {

function lock(&$Model, $fields = null, $id = null) {
$Model->contain();
$data = $Model->read($this->settings[$Model->alias]['fields'], $id);
if($data = $Model->read($this->settings[$Model->alias]['fields'], $id) == false) {
return false;
}
$this->Session = new CakeSession();
$user_id = $this->Session->read('Auth.User.id');
if($data[$Model->alias]['locked'] && $data[$Model->alias]['locked_by'] != $user_id) {
Expand Down

0 comments on commit fcd9bb4

Please sign in to comment.