Fix v20 php8 patch001 (#30932)

* Fix PHP 8 notices, warninngs, fatal

* precommit
This commit is contained in:
John BOTELLA 2024-09-12 21:10:01 +02:00 committed by GitHub
parent d40e0c6026
commit aaa65ddf6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 4 deletions

View file

@ -2233,7 +2233,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr
foreach ($histo as $key => $value) {
$actionstatic->fetch($histo[$key]['id']); // TODO Do we need this, we already have a lot of data of line into $histo
$actionstatic->type_picto = $histo[$key]['apicto'];
$actionstatic->type_picto = $histo[$key]['apicto'] ?? '';
$actionstatic->type_code = $histo[$key]['acode'];
$out .= '<tr class="oddeven">';

View file

@ -98,13 +98,21 @@ class mod_expedition_ribera extends ModelNumRefExpedition
*/
public function getExample()
{
global $langs, $mysoc;
global $langs, $mysoc, $db;
$old_code_client = $mysoc->code_client;
$old_code_type = $mysoc->typent_code;
$mysoc->code_client = 'CCCCCCCCCC';
$mysoc->typent_code = 'TTTTTTTTTT';
$numExample = $this->getNextValue($mysoc, '');
if (!class_exists('Expedition')) {
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
}
$expedition = new Expedition($db);
$numExample = $this->getNextValue($mysoc, $expedition);
$mysoc->code_client = $old_code_client;
$mysoc->typent_code = $old_code_type;
@ -134,7 +142,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition
return 0;
}
$date = $shipment->date_expedition;
$date = $shipment->date_shipping;
$numFinal = get_next_value($db, $mask, 'expedition', 'ref', '', $objsoc, $date);