Commit 2dda9bf2 authored by Carsten  Rose's avatar Carsten Rose
Browse files

#Bug 4127 / Record Locking: save() impliziert 'release' - fixed

parent deb651e9
......@@ -271,22 +271,23 @@ class QuickFormQuery {
if ($formMode === FORM_DELETE || $formMode === FORM_SAVE) {
$recordDirty = array();
$dirty = new Dirty();
// $dirty->checkDirtyAndRelease($formMode, $this->formSpec[F_RECORD_LOCK_TIMEOUT_SECONDS],
// $this->formSpec[F_DIRTY_MODE], $this->formSpec[F_TABLE_NAME], $recordId);
$lockStatus = $dirty->getCheckDirty($this->formSpec[F_TABLE_NAME], $recordId, $recordDirty, $msg);
switch ($lockStatus) {
case LOCK_NOT_FOUND:
if ($this->formSpec[F_DIRTY_MODE] != DIRTY_MODE_NONE) {
throw new UserFormException("Missing record lock: please reload the form, edit and save again.", ERROR_DIRTY_MISSING_LOCK);
}
break;
case LOCK_FOUND_CONFLICT:
throw new UserFormException($msg, ERROR_DIRTY_ALREADY_LOCKED);
case LOCK_FOUND_OWNER:
break;
default:
}
// Comment as long as long as 4127 is open
$dirty->checkDirtyAndRelease($formMode, $this->formSpec[F_RECORD_LOCK_TIMEOUT_SECONDS],
$this->formSpec[F_DIRTY_MODE], $this->formSpec[F_TABLE_NAME], $recordId);
//
// $lockStatus = $dirty->getCheckDirty($this->formSpec[F_TABLE_NAME], $recordId, $recordDirty, $msg);
// switch ($lockStatus) {
// case LOCK_NOT_FOUND:
// if ($this->formSpec[F_DIRTY_MODE] != DIRTY_MODE_NONE) {
// throw new UserFormException("Missing record lock: please reload the form, edit and save again.", ERROR_DIRTY_MISSING_LOCK);
// }
// break;
// case LOCK_FOUND_CONFLICT:
// throw new UserFormException($msg, ERROR_DIRTY_ALREADY_LOCKED);
// case LOCK_FOUND_OWNER:
// break;
// default:
// }
}
if ($formMode === FORM_DELETE) {
......
......@@ -326,9 +326,9 @@ class Dirty {
// Is the dirtyRecord mine?
if ($lockStatus == LOCK_FOUND_OWNER) {
// Uncommentent as long as '#4127 /Record Locking: save() impliziert 'release'' is open
// if (false == $this->checkModified($tableName, $recordId, $recordDirty[DIRTY_RECORD_MODIFIED])) {
// return [API_STATUS => API_ANSWER_STATUS_CONFLICT, API_MESSAGE => 'The record has been modified in the meantime. Please reload the form, edit and save again.'];
// }
if (false == $this->checkModified($tableName, $recordId, $recordDirty[DIRTY_RECORD_MODIFIED])) {
return [API_STATUS => API_ANSWER_STATUS_CONFLICT, API_MESSAGE => 'The record has been modified in the meantime. Please reload the form, edit and save again.'];
}
// Clear the lock
$this->deleteDirtyRecord($recordDirty[COLUMN_ID]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment