N°8215 - When PHP warning are enabled, Global Request doesn't work

This commit is contained in:
jf-cbd
2025-02-21 13:20:27 +01:00
parent 355da8ec0a
commit 94d6eca0c1

View File

@@ -1339,6 +1339,7 @@ class ObjectFormManager extends FormManager
$this->aFieldsAtts = array();
$this->aExtraData = array();
$aFieldsDMOnlyAttCodes = array();
if (array_key_exists('type', $this->aFormProperties)) {
switch ($this->aFormProperties['type']) {
case 'custom_list':
case 'static':
@@ -1386,8 +1387,8 @@ class ObjectFormManager extends FormManager
}
break;
}
if ($this->aFormProperties['layout'] !== null) {
}
if (isset($this->aFormProperties['layout'])) {
$oXPath = new DOMXPath($this->oHtmlDocument);
/** @var \DOMElement $oFieldNode */
foreach ($oXPath->query('//div[contains(@class, "form_field")][@data-field-id]') as $oFieldNode) {
@@ -1446,7 +1447,7 @@ class ObjectFormManager extends FormManager
// Also, retrieving mandatory attributes from metamodel to be able to complete the form with them if necessary
//
// Note: When in a transition, we don't do this for fields that should be set from DM
if ($this->aFormProperties['type'] !== 'static') {
if (array_key_exists('type', $this->aFormProperties) && $this->aFormProperties['type'] !== 'static') {
if ($this->IsTransitionForm()) {
$aDatamodelAttCodes = $this->oObject->GetTransitionAttributes($this->aFormProperties['stimulus_code']);
}
@@ -1552,7 +1553,7 @@ class ObjectFormManager extends FormManager
}
$this->oHtmlDocument = new DOMDocument();
if ($this->aFormProperties['layout'] !== null) {
if (isset($this->aFormProperties['layout'])) {
// Checking if we need to render the template from twig to html in order to parse the fields
if ($this->aFormProperties['layout']['type'] === 'twig') {
if ($this->oFormHandlerHelper !== null) {