1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-13 11:06:20 +02:00

Fixes batch process issue under PHP 7.3

This commit is contained in:
Cameron
2019-03-03 13:08:02 -08:00
parent 4e07b87e37
commit 037c7c67ff
2 changed files with 15 additions and 4 deletions

View File

@ -3093,7 +3093,7 @@ class e_admin_controller_ui extends e_admin_controller
$tree->setTree($arr,true); // set the newly ordered tree.
var_dump($arr);
// var_dump($arr);
return $this->_tree_model;
}
@ -3307,15 +3307,16 @@ class e_admin_controller_ui extends e_admin_controller
return $this;
}
}
if($selected)
{
foreach ($selected as $i => $_sel)
{
$selected[$i] = preg_replace('/[^\w-:.]/', '', $_sel);
$selected[$i] = (int) $_sel; // preg_replace('/[^\w-:.]/', '', $_sel); // php 7.3 doesn't like this.
}
}
if(substr($batch_trigger, 0, 6) === 'batch_')
{
list($tmp,$plugin,$command) = explode("_",$batch_trigger,3);
@ -3471,7 +3472,8 @@ class e_admin_controller_ui extends e_admin_controller
$this->handleCommaBatch($selected, $field, array_keys($classes), $trigger[0] === 'ucdelall' ? 'clearAll' : 'addAll');
}
break;
// handleListCopyBatch etc.
default:
$field = $trigger[0];
$value = $trigger[1];

View File

@ -3980,6 +3980,14 @@ class e_admin_tree_model extends e_front_tree_model
*/
public function copy($ids, $session_messages = false)
{
if(empty($ids[0]))
{
$this->addMessageError('No IDs provided', $session_messages); //TODO - Lan
$this->addMessageDebug(print_a(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS),true),$session_messages); //TODO - Lan
return false;
}
$tp = e107::getParser();
$ids = array_map(array($tp, 'toDB'), $ids);
$idstr = implode(', ', $ids);
@ -3996,6 +4004,7 @@ class e_admin_tree_model extends e_front_tree_model
{
$this->addMessageError('SQL Copy Error', $session_messages); //TODO - Lan
$this->addMessageDebug('SQL Error #'.$sql->getLastErrorNumber().': '.$sql->getLastErrorText());
$this->addMessageDebug('$SQL Query'.print_a($sql->getLastQuery(),true));
}
}
$this->_db_errno = $sql->getLastErrorNumber();