Fix warning php 8.2

This commit is contained in:
Laurent Destailleur 2023-03-26 18:48:29 +02:00
parent b5bb93d3ba
commit cff11abce4
2 changed files with 7 additions and 2 deletions

View File

@ -1324,10 +1324,10 @@ class FormMail extends Form
$sql .= " AND (lang = '".$dbs->escape($languagetosearch)."'".($languagetosearchmain ? " OR lang = '".$dbs->escape($languagetosearchmain)."'" : "")." OR lang IS NULL OR lang = '')";
}
if ($id > 0) {
$sql .= " AND rowid=".(int) $id;
$sql .= " AND rowid = ".(int) $id;
}
if ($id == -1) {
$sql .= " AND position=0";
$sql .= " AND position = 0";
}
if ($languagetosearch) {
$sql .= $dbs->order("position,lang,label", "ASC,DESC,ASC"); // We want line with lang set first, then with lang null or ''

View File

@ -375,6 +375,11 @@ class modEventOrganization extends DolibarrModules
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($this->db);
include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
if (!is_object($user)) {
$user = new User($this->db); // To avoid error during migration
}
$template = $formmail->getEMailTemplate($this->db, 'conferenceorbooth', $user, $langs, 0, 1, '(EventOrganizationEmailAskConf)');
if ($template->id > 0) {
dolibarr_set_const($this->db, 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF', $template->id, 'chaine', 0, '', $conf->entity);