Commit 2bf035a9 authored by Carsten  Rose's avatar Carsten Rose
Browse files

#3546 / lean: Internal Server Error

Action elements, assigned to a container which are not a templategroup, threw an exception. In general, it makes no sense (at the time of writing this) to assign an action element to a pill or fieldset, but it should not throw an exception. Fixed - just ignore such assignment.
parent f6172fca
......@@ -715,6 +715,8 @@ const FE_TYPE_AFTER_INSERT = 'afterInsert';
const FE_TYPE_AFTER_UPDATE = 'afterUpdate';
const FE_TYPE_AFTER_DELETE = 'afterDelete';
const FE_TYPE_TEMPLATE_GROUP = 'templateGroup';
// SUPPORT
const PARAM_T3_ALL = 't3 all';
const PARAM_T3_NO_ID = "t3 no id";
......
......@@ -89,7 +89,7 @@ class FormAction {
// Get native 'templateGroup'-FE - to retrieve MAX_LENGTH
$feTemplateGroup = $this->db->sql(SQL_FORM_ELEMENT_TEMPLATE_GROUP_FE_ID, ROW_REGULAR, [$fe[FE_ID_CONTAINER]]);
if (isset($feTemplateGroup[0][FE_TYPE]) && $feTemplateGroup[0][FE_TYPE] == FE_TYPE_TEMPLATE_GROUP) {
if (count($feTemplateGroup) == 1) {
$fe[FE_ID_CONTAINER] = 0;
for ($ii = 1; $ii <= $feTemplateGroup[0][FE_MAX_LENGTH]; $ii++) {
......@@ -105,6 +105,7 @@ class FormAction {
}
continue; // skip to next FormElement
}
}
switch ($fe[FE_TYPE]) {
case FE_TYPE_BEFORE_LOAD:
......@@ -128,7 +129,7 @@ class FormAction {
$config = OnArray::getArrayItems($fe, [FE_LDAP_SERVER, FE_LDAP_BASE_DN, FE_LDAP_SEARCH, FE_LDAP_ATTRIBUTES, FE_LDAP_USE_BIND_CREDENTIALS]);
$config = $this->evaluate->parseArray($config);
if($fe[FE_LDAP_USE_BIND_CREDENTIALS]==1) {
if ($fe[FE_LDAP_USE_BIND_CREDENTIALS] == 1) {
$config[SYSTEM_LDAP_1_RDN] = $this->store->getVar(SYSTEM_LDAP_1_RDN, STORE_SYSTEM);
$config[SYSTEM_LDAP_1_PASSWORD] = $this->store->getVar(SYSTEM_LDAP_1_PASSWORD, STORE_SYSTEM);
}
......@@ -356,6 +357,7 @@ class FormAction {
}
return false;
}
/**
* Set all necessary keys - subsequent 'isset()' are not necessary anymore.
*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment