mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-26 21:01:30 +02:00
stop server-side validation errors, if submit was with no_validation
This commit is contained in:
parent
ca07e19573
commit
ce3c5c897f
@ -241,8 +241,13 @@ class etemplate_new extends etemplate_widget_template
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Process via Ajax submitted content
|
* Process via Ajax submitted content
|
||||||
|
*
|
||||||
|
* @param string $etemplate_exec_id
|
||||||
|
* @param array $content
|
||||||
|
* @param boolean $no_validation
|
||||||
|
* @throws egw_exception_wrong_parameter
|
||||||
*/
|
*/
|
||||||
static public function ajax_process_content($etemplate_exec_id, array $content)
|
static public function ajax_process_content($etemplate_exec_id, array $content, $no_validation)
|
||||||
{
|
{
|
||||||
//error_log(__METHOD__."(".array2string($etemplate_exec_id).', '.array2string($content).")");
|
//error_log(__METHOD__."(".array2string($etemplate_exec_id).', '.array2string($content).")");
|
||||||
|
|
||||||
@ -271,7 +276,11 @@ class etemplate_new extends etemplate_widget_template
|
|||||||
);
|
);
|
||||||
$template->run('validate', array('', $expand, $content, &$validated), true); // $respect_disabled=true: do NOT validate disabled widgets and children
|
$template->run('validate', array('', $expand, $content, &$validated), true); // $respect_disabled=true: do NOT validate disabled widgets and children
|
||||||
|
|
||||||
if (self::validation_errors(self::$request->ignore_validation))
|
if ($no_validation)
|
||||||
|
{
|
||||||
|
self::$validation_errors = array();
|
||||||
|
}
|
||||||
|
elseif (self::validation_errors(self::$request->ignore_validation))
|
||||||
{
|
{
|
||||||
error_log(__METHOD__."(,".array2string($content).') validation_errors='.array2string(self::$validation_errors));
|
error_log(__METHOD__."(,".array2string($content).') validation_errors='.array2string(self::$validation_errors));
|
||||||
self::$response->generic('et2_validation_error', self::$validation_errors);
|
self::$response->generic('et2_validation_error', self::$validation_errors);
|
||||||
|
@ -551,7 +551,7 @@ etemplate2.prototype.submit = function(button, async, no_validation)
|
|||||||
this.unbind_unload();
|
this.unbind_unload();
|
||||||
|
|
||||||
var api = this.widgetContainer.egw();
|
var api = this.widgetContainer.egw();
|
||||||
var request = api.json(this.menuaction, [this.etemplate_exec_id,values], null, this, async);
|
var request = api.json(this.menuaction, [this.etemplate_exec_id, values, no_validation], null, this, async);
|
||||||
request.sendRequest();
|
request.sendRequest();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user