diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index 69450fe94..bb343356e 100755 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -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]; diff --git a/e107_handlers/model_class.php b/e107_handlers/model_class.php index a9a1050ac..809256f6e 100755 --- a/e107_handlers/model_class.php +++ b/e107_handlers/model_class.php @@ -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();