Skip to content

Commit

Permalink
fix(MassEdit) Moving the preg_replace out of the loop
Browse files Browse the repository at this point in the history
  • Loading branch information
tebajanga committed Aug 4, 2018
1 parent c8999d2 commit 9e611ef
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/Vtiger/MassEditSave.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ function send_message($id, $message, $progress, $processed, $total) {
$exists = executefunctionsvalidate('ValidationExists', $currentModule);
if (isset($idlist)) {
$_REQUEST['action'] = 'MassEditSave';

// Replacing params action value
$_REQUEST['params'] = preg_replace('/"action":""/', '"action":"MassEditSave"', $_REQUEST['params']);

$recordids = explode(';', $idlist);
$recordcount = count($recordids)-1;
$id = 1;
Expand Down Expand Up @@ -84,9 +88,6 @@ function send_message($id, $message, $progress, $processed, $total) {
list($saveerror,$errormessage,$error_action,$returnvalues) = $focus->preSaveCheck($params);
if (!$saveerror) { // if there is an error we ignore this record
if ($exists == 'yes') {
// Replacing action value
$_REQUEST['params'] = preg_replace('/"action":""/', '"action":"MassEditSave"', $_REQUEST['params']);

$validation = executefunctionsvalidate('ValidationLoad', $currentModule, vtlib_purify($_REQUEST['params']));
if ($validation == '%%%OK%%%') {
$msg = $app_strings['record'].' '.$recordid.' '.$app_strings['saved'];
Expand Down

0 comments on commit 9e611ef

Please sign in to comment.