Bläddra i källkod

Fix : PHP 8.0 warnings

Lucas Marcouiller 3 år sedan
förälder
incheckning
b3e9aeef7a
3 ändrade filer med 6 tillägg och 7 borttagningar
  1. 1 1
      htdocs/core/lib/files.lib.php
  2. 0 3
      htdocs/imports/emptyexample.php
  3. 5 3
      htdocs/modulebuilder/index.php

+ 1 - 1
htdocs/core/lib/files.lib.php

@@ -107,7 +107,7 @@ function dol_dir_list($path, $types = "all", $recursive = 0, $filter = "", $excl
 		if ($dir = opendir($newpath)) {
 			$filedate = '';
 			$filesize = '';
-
+			$fileperm = '';
 			while (false !== ($file = readdir($dir))) {        // $file is always a basename (into directory $newpath)
 				if (!utf8_check($file)) {
 					$file = utf8_encode($file); // To be sure data is stored in utf8 in memory

+ 0 - 3
htdocs/imports/emptyexample.php

@@ -75,9 +75,6 @@ $filename = $langs->trans("ExampleOfImportFile").'_'.$datatoimport.'.'.$format;
 $objimport = new Import($db);
 $objimport->load_arrays($user, $datatoimport);
 // Load arrays from descriptor module
-$entity = $objimport->array_import_entities[0][$code];
-$entityicon = $entitytoicon[$entity] ? $entitytoicon[$entity] : $entity;
-$entitylang = $entitytolang[$entity] ? $entitytolang[$entity] : $entity;
 $fieldstarget = $objimport->array_import_fields[0];
 $valuestarget = $objimport->array_import_examplevalues[0];
 

+ 5 - 3
htdocs/modulebuilder/index.php

@@ -1845,9 +1845,11 @@ if (is_array($listofmodules) && count($listofmodules) > 0) {
 			$linktoenabledisable .= ' &nbsp; <a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 8px"').'</a>';
 		}
 	} else {
-		$linktoenabledisable .= '<a class="reposition asetresetmodule valignmiddle" href="'.$_SERVER["PHP_SELF"].'?id='.$moduleobj->numero.'&action=set&token='.newToken().'&value=mod'.$module.$param.'">';
-		$linktoenabledisable .= img_picto($langs->trans("ModuleIsNotActive", $urltomodulesetup), 'switch_off', 'style="padding-right: 8px"', false, 0, 0, '', 'classfortooltip', 1);
-		$linktoenabledisable .= "</a>\n";
+		if (!empty($moduleobj)) {
+			$linktoenabledisable .= '<a class="reposition asetresetmodule valignmiddle" href="'.$_SERVER["PHP_SELF"].'?id='.$moduleobj->numero.'&action=set&token='.newToken().'&value=mod'.$module.$param.'">';
+			$linktoenabledisable .= img_picto($langs->trans("ModuleIsNotActive", $urltomodulesetup), 'switch_off', 'style="padding-right: 8px"', false, 0, 0, '', 'classfortooltip', 1);
+			$linktoenabledisable .= "</a>\n";
+		}
 	}
 
 	// Loop to show tab of each module