Merge pull request #19204 from FHenry/fix_introduced_scrutinizer

Fix introduced scrutinizer
This commit is contained in:
Laurent Destailleur 2021-10-31 17:37:31 +01:00 committed by GitHub
commit ae103f20ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 11 deletions

View File

@ -795,7 +795,7 @@ if ($type == Categorie::TYPE_CONTACT) {
$permission = $user->rights->societe->creer;
$contacts = $object->getObjectsInCateg($type, 0, $limit, $offset);
if ($contacts < 0) {
if (is_numeric($contacts) && $contacts < 0) {
dol_print_error($db, $object->error, $object->errors);
} else {
// Form to add record into a category

View File

@ -320,17 +320,22 @@ class doc_generic_odt extends ModeleThirdPartyDoc
foreach ($contact_arrray as $array_key => $contact_id) {
$res_contact = $contactstatic->fetch($contact_id);
$tmparray = $this->get_substitutionarray_contact($contactstatic, $outputlangs, 'contact');
foreach ($tmparray as $key => $val) {
try {
$listlines->setVars($key, $val, true, 'UTF-8');
} catch (OdfException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
} catch (SegmentException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
if ((int) $res_contact > 0) {
$tmparray = $this->get_substitutionarray_contact($contactstatic, $outputlangs, 'contact');
foreach ($tmparray as $key => $val) {
try {
$listlines->setVars($key, $val, true, 'UTF-8');
} catch (OdfException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
} catch (SegmentException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlines->merge();
} else {
$this->error = $contactstatic->error;
dol_syslog($this->error, LOG_WARNING);
}
$listlines->merge();
}
$odfHandler->mergeSegment($listlines);
} catch (OdfException $e) {

View File

@ -224,8 +224,9 @@ class FormResource
$value = ($maxlength ?dol_trunc($arraytypes['label'], $maxlength) : $arraytypes['label']);
} elseif ($format == 3) {
$value = $arraytypes['code'];
} elseif (empty($value)) {
print '&nbsp;';
}
print $value ? $value : '&nbsp;';
print '</option>';
}
}