Skip to content
Snippets Groups Projects
Commit 42171990 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Fixes #8853. fe.class=action: container should be hidden - hidden is wrong -...

Fixes #8853. fe.class=action: container should be hidden - hidden is wrong - FE-action might be assigned to templateGroup Container. New solution: if FE.class='action' only templateGroups are in the 'container' list.
parent af179ab3
No related branches found
No related tags found
No related merge requests found
Pipeline #2171 passed
......@@ -123,7 +123,7 @@ class FormAction {
if (isset($fe[FE_ID_CONTAINER]) && $fe[FE_ID_CONTAINER] > 0) {
// Get native 'templateGroup'-FE - to retrieve MAX_LENGTH
$templateGroup = $this->db->sql(SQL_FORM_ELEMENT_TEMPLATE_GROUP_FE_ID, ROW_EXPECT_1, [$fe[FE_ID_CONTAINER]],
"In FormElement.id=" . $fe[FE_ID] . ", feIdContainer=" . $fe[FE_ID_CONTAINER] . ' should point to a templateGroup');
"Action FormElements should not be assigned to a container (exception: templateGroup). FormElement.id=" . $fe[FE_ID] . ", feIdContainer=" . $fe[FE_ID_CONTAINER] . ' is not a templateGroup');
if (isset($templateGroup[FE_TYPE]) && $templateGroup[FE_TYPE] == FE_TYPE_TEMPLATE_GROUP) {
$maxCopies = HelperFormElement::tgGetMaxLength($templateGroup[FE_MAX_LENGTH]);
......
......@@ -321,10 +321,10 @@ INSERT INTO FormElement (formId, name, label, mode, type, checkType, class, ord,
bsNoteColumns, modeSql, placeholder, encode)
VALUES (2, 'feIdContainer', 'Container', 'show', 'select', 'all', 'native', 120, 0, 0,
'<a href="{{documentation:Y}}#class-container">Info</a>', '',
'{{feIdContainer:R:::{{SELECT fe.feIdContainer FROM FormElement AS fe WHERE fe.formId={{formId:SR0}} AND fe.feIdContainer!=0 ORDER BY fe.modified DESC LIMIT 1}}}}',
'{{!SELECT fe.id, CONCAT(fe.type, " / ", fe.name, " (", COUNT(feSub.id), ")" ) FROM FormElement As fe LEFT JOIN FormElement As feSub ON feSub.feIdContainer=fe.id WHERE fe.formId={{formId:SR0}} AND fe.class="container" GROUP BY fe.id ORDER BY fe.type, fe.ord, fe.name }}',
'{{feIdContainer:FR:::{{SELECT fe.feIdContainer FROM FormElement AS fe WHERE fe.formId={{formId:SR0}} AND fe.feIdContainer!=0 AND "{{class:FRD0:alnumx}}"!="action" ORDER BY fe.modified DESC LIMIT 1}}}}',
'{{!SELECT fe.id, CONCAT(fe.type, " / ", fe.name, " (", COUNT(feSub.id), ")" ) FROM FormElement As fe LEFT JOIN FormElement As feSub ON feSub.feIdContainer=fe.id WHERE fe.formId={{formId:SR0}} AND fe.class="container" AND ("{{class:FRD0:alnumx}}"!="action" OR fe.type="templateGroup") GROUP BY fe.id ORDER BY fe.type, fe.ord, fe.name }}',
'emptyItemAtStart',
100, '', 'no', '', '', '',
100, '', 'yes', '', '', '',
'{{SELECT IF(COUNT(fe.id)>0, "show", "hidden") FROM Form AS f LEFT JOIN FormElement AS fe ON f.id=fe.formId AND fe.class="container" WHERE f.id={{formId:S0}} GROUP BY f.id}}',
'', 'specialchar'),
(2, 'enabled', 'Enabled', 'show', 'checkbox', 'all', 'native', 130, 0, 0,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment