浏览代码

Fix php 8 warning on not set field keys

Francis Appels 3 年之前
父节点
当前提交
1333ca3660

+ 1 - 1
htdocs/bom/bom_list.php

@@ -108,7 +108,7 @@ foreach ($object->fields as $key => $val) {
 			'checked'=>(($visible < 0) ? 0 : 1),
 			'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
 			'position'=>$val['position'],
-			'help'=>$val['help']
+			'help'=> isset($val['help']) ? $val['help'] : ''
 		);
 	}
 }

+ 1 - 1
htdocs/compta/cashcontrol/cashcontrol_list.php

@@ -131,7 +131,7 @@ foreach ($object->fields as $key => $val) {
 			'checked'=>(($visible < 0) ? 0 : 1),
 			'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
 			'position'=>$val['position'],
-			'help'=>$val['help']
+			'help'=> isset($val['help']) ? $val['help'] : ''
 		);
 	}
 }

+ 1 - 1
htdocs/core/tpl/commonfields_add.tpl.php

@@ -47,7 +47,7 @@ foreach ($object->fields as $key => $val) {
 	print '<tr class="field_'.$key.'">';
 	print '<td';
 	print ' class="titlefieldcreate';
-	if ($val['notnull'] > 0) {
+	if (isset($val['notnull']) && $val['notnull'] > 0) {
 		print ' fieldrequired';
 	}
 	if ($val['type'] == 'text' || $val['type'] == 'html') {

+ 1 - 1
htdocs/core/tpl/commonfields_edit.tpl.php

@@ -48,7 +48,7 @@ foreach ($object->fields as $key => $val) {
 
 	print '<tr class="field_'.$key.'"><td';
 	print ' class="titlefieldcreate';
-	if ($val['notnull'] > 0) {
+	if (isset($val['notnull']) && $val['notnull'] > 0) {
 		print ' fieldrequired';
 	}
 	if (preg_match('/^(text|html)/', $val['type'])) {

+ 1 - 1
htdocs/eventorganization/conferenceorbooth_list.php

@@ -119,7 +119,7 @@ foreach ($object->fields as $key => $val) {
 			'checked'=>(($visible < 0) ? 0 : 1),
 			'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
 			'position'=>$val['position'],
-			'help'=>$val['help']
+			'help'=> isset($val['help']) ? $val['help'] : ''
 		);
 	}
 }

+ 1 - 1
htdocs/eventorganization/conferenceorboothattendee_list.php

@@ -128,7 +128,7 @@ foreach ($object->fields as $key => $val) {
 			'checked'=>(($visible < 0) ? 0 : 1),
 			'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
 			'position'=>$val['position'],
-			'help'=>$val['help']
+			'help'=> isset($val['help']) ? $val['help'] : ''
 		);
 	}
 }

+ 1 - 1
htdocs/knowledgemanagement/knowledgerecord_list.php

@@ -115,7 +115,7 @@ foreach ($object->fields as $key => $val) {
 			'checked'=>(($visible < 0) ? 0 : 1),
 			'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
 			'position'=>$val['position'],
-			'help'=>$val['help']
+			'help'=> isset($val['help']) ? $val['help'] : ''
 		);
 	}
 }

+ 1 - 1
htdocs/modulebuilder/template/myobject_list.php

@@ -165,7 +165,7 @@ foreach ($object->fields as $key => $val) {
 			'checked'=>(($visible < 0) ? 0 : 1),
 			'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
 			'position'=>$val['position'],
-			'help'=>$val['help']
+			'help'=> isset($val['help']) ? $val['help'] : ''
 		);
 	}
 }

+ 1 - 1
htdocs/mrp/mo_list.php

@@ -115,7 +115,7 @@ foreach ($object->fields as $key => $val) {
 			'checked'=>(($visible < 0) ? 0 : 1),
 			'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
 			'position'=>$val['position'],
-			'help'=>$val['help']
+			'help'=> isset($val['help']) ? $val['help'] : ''
 		);
 	}
 }

+ 1 - 1
htdocs/partnership/partnership_list.php

@@ -126,7 +126,7 @@ foreach ($object->fields as $key => $val) {
 			'checked'=>(($visible < 0) ? 0 : 1),
 			'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
 			'position'=>$val['position'],
-			'help'=>$val['help']
+			'help'=> isset($val['help']) ? $val['help'] : ''
 		);
 	}
 }

+ 1 - 1
htdocs/product/inventory/list.php

@@ -108,7 +108,7 @@ foreach ($object->fields as $key => $val) {
 			'checked'=>(($visible < 0) ? 0 : 1),
 			'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
 			'position'=>$val['position'],
-			'help'=>$val['help']
+			'help'=> isset($val['help']) ? $val['help'] : ''
 		);
 	}
 }

+ 1 - 1
htdocs/product/stock/list.php

@@ -123,7 +123,7 @@ foreach ($object->fields as $key => $val) {
 			'checked'=>(($visible < 0) ? 0 : 1),
 			'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
 			'position'=>$val['position'],
-			'help'=>$val['help']
+			'help'=> isset($val['help']) ? $val['help'] : 'help'
 		);
 	}
 }

+ 1 - 1
htdocs/projet/list.php

@@ -167,7 +167,7 @@ foreach ($object->fields as $key => $val) {
 			'checked'=>(($visible < 0) ? 0 : 1),
 			'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
 			'position'=>$val['position'],
-			'help'=>$val['help']
+			'help'=> isset($val['help']) ? $val['help'] : ''
 		);
 	}
 }

+ 1 - 1
htdocs/salaries/list.php

@@ -140,7 +140,7 @@ foreach ($object->fields as $key => $val) {
 			'checked'=>(($visible < 0) ? 0 : 1),
 			'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
 			'position'=>$val['position'],
-			'help'=>$val['help']
+			'help'=> isset($val['help']) ? $val['help'] : ''
 		);
 	}
 }

+ 1 - 1
htdocs/salaries/payments.php

@@ -135,7 +135,7 @@ foreach ($object->fields as $key => $val) {
 			'checked'=>(($visible < 0) ? 0 : 1),
 			'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
 			'position'=>$val['position'],
-			'help'=>$val['help']
+			'help'=> isset($val['help']) ? $val['help'] : ''
 		);
 	}
 }