Commit ac7f1e72 authored by Carsten  Rose's avatar Carsten Rose
Browse files

#4311 / Record Lock: expired lock wird nicht geloescht bei form reload

New logic requires not to complain about missing lock during release.
parent 8d5645ed
......@@ -333,9 +333,13 @@ class Dirty {
}
// This is pessimistic, but secure.
throw new UserFormException("Missing record lock: please reload the form, edit and save again.", ERROR_DIRTY_MISSING_LOCK);
// throw new UserFormException("Missing record lock: please reload the form, edit and save again.", ERROR_DIRTY_MISSING_LOCK);
// New logic: a missing lock is not a problem. Reason: it's easy to delete an expired lock, but than it's hard to verify a release for an expired lock.
return $answer;
}
if ($formMode == FORM_DELETE) {
// Check if the record is timed out
if ($lockTimeout > 0 && $rcRecordDirty[DIRTY_EXPIRE] < date('Y-m-d H:i:s')) {
......
......@@ -549,16 +549,16 @@ class DirtyTest extends \AbstractDatabaseTest {
/**
* @expectedException \qfq\UserFormException
*/
public function testExclusiveAliceReleaseException() {
$_GET[CLIENT_SIP] = $this->sip->queryStringToSip("?id=input&r=1&form=lockExclusive", RETURN_SIP);
// Alice release
$_GET[DIRTY_API_ACTION] = DIRTY_API_ACTION_RELEASE;
$dirty = new \qfq\Dirty();
$dirty->process();
}
// public function testExclusiveAliceReleaseException() {
//
// $_GET[CLIENT_SIP] = $this->sip->queryStringToSip("?id=input&r=1&form=lockExclusive", RETURN_SIP);
//
// // Alice release
// $_GET[DIRTY_API_ACTION] = DIRTY_API_ACTION_RELEASE;
// $dirty = new \qfq\Dirty();
//
// $dirty->process();
// }
/**
* Alice lock, Record modified by someone else, Alice release
......
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