From db241b22dd28165980996c09f7f3de7a92dd4133 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Jun 2019 14:33:04 +0200 Subject: [PATCH 1/3] Fix clean of database --- htdocs/install/repair.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 8403bd44321..fc9c63e4a40 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -452,17 +452,19 @@ if ($ok && GETPOST('standard', 'alpha')) if ($obj2 && $obj2->nb == 0) { // Module not found, so we canremove entry - $sqldelete = "DELETE FROM ".MAIN_DB_PREFIX."boxes_def WHERE file = '".$obj->file."' AND entity = ".$obj->entity; + $sqldeletea = "DELETE FROM ".MAIN_DB_PREFIX."boxes WHERE entity = ".$obj->entity." AND box_id IN (SELECT rowid FROM ".MAIN_DB_PREFIX."boxes_def WHERE file = '".$obj->file."' AND entity = ".$obj->entity.")"; + $sqldeleteb = "DELETE FROM ".MAIN_DB_PREFIX."boxes_def WHERE file = '".$obj->file."' AND entity = ".$obj->entity; if (GETPOST('standard', 'alpha') == 'confirmed') { - $db->query($sqldelete); + $db->query($sqldeletea); + $db->query($sqldeleteb); - print 'Constant '.$obj->file.' set in llx_boxes for entity '.$obj->entity.' but MAIN_MODULE_'.strtoupper($module).' not defined in entity '.$obj->entity.', we delete record'; + print 'Constant '.$obj->file.' set in boxes_def for entity '.$obj->entity.' but MAIN_MODULE_'.strtoupper($module).' not defined in entity '.$obj->entity.', we delete record'; } else { - print 'Constant '.$obj->file.' set in llx_boxes for entity '.$obj->entity.' but MAIN_MODULE_'.strtoupper($module).' not defined in entity '.$obj->entity.', we should delete record (not done, mode test)'; + print 'Constant '.$obj->file.' set in boxes_def for entity '.$obj->entity.' but MAIN_MODULE_'.strtoupper($module).' not defined in entity '.$obj->entity.', we should delete record (not done, mode test)'; } } else From 662afe8a3606c5aee6a34043324198bdd99b9dab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Jun 2019 18:24:29 +0200 Subject: [PATCH 2/3] Fix missing global --- htdocs/core/class/dolgraph.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 8b7bc4acf18..d7850871ee0 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -891,6 +891,7 @@ class DolGraph private function draw_jflot($file, $fileurl) { // phpcs:enable + global $langs; dol_syslog(get_class($this)."::draw_jflot this->type=".join(',', $this->type)." this->MaxValue=".$this->MaxValue); From e456cd27d1e1d16bebbff27bcc79b594bfad5a89 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Jun 2019 18:42:24 +0200 Subject: [PATCH 3/3] Fix deprecated call and hide pass in debug --- htdocs/debugbar/class/DataCollector/DolConfigCollector.php | 1 + htdocs/debugbar/class/DataCollector/DolQueryCollector.php | 4 ---- htdocs/debugbar/class/DataCollector/DolibarrCollector.php | 6 +++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/htdocs/debugbar/class/DataCollector/DolConfigCollector.php b/htdocs/debugbar/class/DataCollector/DolConfigCollector.php index a3fa8b84a92..65c33af013e 100644 --- a/htdocs/debugbar/class/DataCollector/DolConfigCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolConfigCollector.php @@ -77,6 +77,7 @@ class DolConfigCollector extends ConfigCollector protected function objectToArray($obj) { // phpcs:enable + $arr=array(); $_arr = is_object($obj) ? get_object_vars($obj) : $obj; foreach ($_arr as $key => $val) { $val = (is_array($val) || is_object($val)) ? $this->objectToArray($val) : $val; diff --git a/htdocs/debugbar/class/DataCollector/DolQueryCollector.php b/htdocs/debugbar/class/DataCollector/DolQueryCollector.php index 694112bf2f1..8430cf41adf 100644 --- a/htdocs/debugbar/class/DataCollector/DolQueryCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolQueryCollector.php @@ -44,9 +44,7 @@ class DolQueryCollector extends DataCollector implements Renderable, AssetProvid $queries[] = array( 'sql' => $query['sql'], 'duration' => $query['duration'], - 'duration_str' => $this->formatDuration($query['duration']), 'memory' => $query['memory_usage'], - 'memory_str' => $this->formatBytes($query['memory_usage']), 'is_success' => $query['is_success'], 'error_code' => $query['error_code'], 'error_message' => $query['error_message'] @@ -62,9 +60,7 @@ class DolQueryCollector extends DataCollector implements Renderable, AssetProvid 'nb_statements' => count($queries), 'nb_failed_statements' => $totalFailed, 'accumulated_duration' => $totalExecTime, - 'accumulated_duration_str' => $this->formatDuration($totalExecTime), 'memory_usage' => $totalMemoryUsage, - 'memory_usage_str' => $this->formatBytes($totalMemoryUsage), 'statements' => $queries ); } diff --git a/htdocs/debugbar/class/DataCollector/DolibarrCollector.php b/htdocs/debugbar/class/DataCollector/DolibarrCollector.php index 8bcd639ec7f..b1471f415a0 100644 --- a/htdocs/debugbar/class/DataCollector/DolibarrCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolibarrCollector.php @@ -66,7 +66,7 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid $info .= $langs->trans('Currency') . ': ' . $conf->currency . '
'; $info .= $langs->trans('DolEntity') . ': ' . $conf->entity . '
'; $info .= $langs->trans('ListLimit') . ': ' . ($conf->liste_limit ?: $conf->global->MAIN_SIZE_LISTE_LIMIT) . '
'; - $info .= $langs->trans('UploadSize') . ': ' . $conf->global->MAIN_UPLOAD_DOC . ''; + $info .= $langs->trans('MaxSizeForUploadedFiles') . ': ' . $conf->global->MAIN_UPLOAD_DOC . ''; return $info; } @@ -84,9 +84,9 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid $info .= $langs->trans('Server') . ': ' . $conf->global->MAIN_MAIL_SMTP_SERVER . '
'; $info .= $langs->trans('Port') . ': ' . $conf->global->MAIN_MAIL_SMTP_PORT . '
'; $info .= $langs->trans('ID') . ': ' . $conf->global->MAIN_MAIL_SMTPS_ID . '
'; - $info .= $langs->trans('Pwd') . ': ' . $conf->global->MAIN_MAIL_SMTPS_PW . '
'; + $info .= $langs->trans('Pwd') . ': ' . preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW) . '
'; $info .= $langs->trans('TLS/STARTTLS') . ': ' . $conf->global->MAIN_MAIL_EMAIL_TLS . ' / ' . $conf->global->MAIN_MAIL_EMAIL_STARTTLS . '
'; - $info .= $langs->trans('Status') . ': ' . ($conf->global->MAIN_DISABLE_ALL_MAILS ? $langs->trans('StatusDisabled') : $langs->trans('StatusEnabled')) . ''; + $info .= $langs->trans('MAIN_DISABLE_ALL_MAILS') . ': ' . ($conf->global->MAIN_DISABLE_ALL_MAILS ? $langs->trans('Yes') : $langs->trans('No')) . ''; return $info; }