mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°3430 - fix preference page's warning and add missing token generation
- fix the warning (ajax call interrupted) if preference form ajax call is way faster than the one of the 2 other by adding a new timeout_duration option before the redirect.
This commit is contained in:
@@ -160,7 +160,9 @@ abstract class FormManager
|
||||
/**
|
||||
* @param array|null $aArgs
|
||||
*
|
||||
* @return mixed
|
||||
* @return array
|
||||
*
|
||||
* @since 2.7.4 3.0.0 N°3430
|
||||
*/
|
||||
public function OnSubmit($aArgs = null)
|
||||
{
|
||||
@@ -179,13 +181,16 @@ abstract class FormManager
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $aData
|
||||
* @param array $aData
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 2.7.4 3.0.0 N°3430
|
||||
*/
|
||||
public function CheckTransaction($aData)
|
||||
{
|
||||
if (! \utils::IsTransactionValid($this->oForm->GetTransactionId())) {
|
||||
$isTransactionValid = \utils::IsTransactionValid($this->oForm->GetTransactionId(), false); //The transaction token is kept in order to preserve BC with ajax forms (the second call would fail if the token is deleted). (The GC will take care of cleaning the token for us later on)
|
||||
if (!$isTransactionValid) {
|
||||
$aData['messages']['error'] += [
|
||||
'_main' => [\Dict::S('UI:Error:InvalidToken')] //This message is generic, if you override this method you should use a more precise message. @see \Combodo\iTop\Portal\Form\ObjectFormManager::CheckTransaction
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user