Commit 2a97a37c authored by Carsten  Rose's avatar Carsten Rose

Fixes #6798 - close didn't worked with r=0 - fixed now.

parent 5224fd22
Pipeline #3348 passed with stages
in 4 minutes and 15 seconds
......@@ -569,17 +569,16 @@ class QuickFormQuery {
break;
}
$customForward = $this->setForwardModePage();
$this->setForwardModePage();
// Logic: If a) r=0 and
// b) User presses only 'save' (not save & close) and
// c) there is no forwardMode=='url...'
// b) final: (forwardMode=='auto' and User presses only 'save' (not 'save & close')) OR (forwardMode=='no')
// then the client should reload the current page with the newly created record. A new SIP is necessary!
$getJson = true;
if (0 == $this->store->getVar(SIP_RECORD_ID, STORE_SIP) &&
API_SUBMIT_REASON_SAVE == $this->store->getVar(API_SUBMIT_REASON, STORE_CLIENT . STORE_EMPTY, SANITIZE_ALLOW_ALNUMX) &&
$customForward == false
) {
if (0 == $this->store->getVar(SIP_RECORD_ID, STORE_SIP)
&& (($this->formSpec[F_FORWARD_MODE] == F_FORWARD_MODE_AUTO
&& API_SUBMIT_REASON_SAVE == $this->store->getVar(API_SUBMIT_REASON, STORE_CLIENT . STORE_EMPTY, SANITIZE_ALLOW_ALNUMX)
) || $this->formSpec[F_FORWARD_MODE] == F_FORWARD_MODE_NO)) {
$this->formSpec = $this->buildNSetReloadUrl($this->formSpec, $rc);
$getJson = false;
}
......@@ -788,12 +787,10 @@ class QuickFormQuery {
*
* '$this->formSpec[F_FORWARD_PAGE]':
* a) url http://www.nzz.ch/index.html?a=123#bottom, website.html?a=123#bottom,
* ?[id=]<T3 Alias pageid>&a=123#bottom, ?id=<T3 page id>&a=123#bottom
* ?[id=]<T3 Alias pageId>&a=123#bottom, ?id=<T3 pageId>&a=123#bottom
* b) mode no|client|url|...
* c) mode|url combination of above
*
* @return bool TRUE if F_FORWARD_MODE = 'url..', else FALSE
*
* @throws \CodeException
* @throws \DbException
* @throws \UserFormException
......@@ -802,7 +799,7 @@ class QuickFormQuery {
private function setForwardModePage() {
if (F_FORWARD_MODE_URL != substr($this->formSpec[F_FORWARD_MODE], 0, 3)) {
return false;
return;
}
$forwardPageTmp = $this->evaluate->parse($this->formSpec[F_FORWARD_PAGE]);
......@@ -832,20 +829,11 @@ class QuickFormQuery {
break;
}
if ('url' == substr($this->formSpec[F_FORWARD_MODE], 0, 3)) {
if (F_FORWARD_MODE_URL == substr($this->formSpec[F_FORWARD_MODE], 0, 3)) {
if ($this->formSpec[F_FORWARD_PAGE] == '') {
$this->formSpec[F_FORWARD_MODE] = F_FORWARD_MODE_AUTO;
$customForward = false;
} else {
$customForward = true;
}
} else {
$customForward = false;
}
return $customForward;
}
/**
......
Markdown is supported
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