#96135IRRE: Hide Record switch not work
Description
If you have an inline record open and then click Hide in the MenuBar, the record is greyed out, but after saving the main record this setting is lost.
The Hide field in the Inline Record, on the other hand, works without problems.
When the inline record is closed, the hide function in the menu bar works normally.
Attached is an example of the extension “news”
Reviews 5
- main 89596[BUGFIX] Properly handle hide / unhide inline controls
- main 88305[POC][BUGFIX] Toggle bitset of hidden field from IRRE toggle
- 13.4 93817[BUGFIX] Adapt IRRE/files toggle switch for invertStateDisplay
- 14.3 93829[BUGFIX] Adapt IRRE/files toggle switch for invertStateDisplay
- main 92362[BUGFIX] Adapt IRRE/files toggle switch for invertStateDisplay
Related issues 5
- Bug #100471appearance.enableControls.hide not working for Inline Elements, when disabled field is rendered in form as checkboxToggle with "invertStateDisplay"
- Bug #105341Unable to hide media resources in page properties (media) if more than one
- Bug #105677File reference cannot be hidden
- Bug #106786Activation/Deactivation Fails with expanded FileReferences in content elements
- Bug #107295Unable to hide/unhide media attached to content elements
Files 4
History 3442
Show 17 earlier messages
-
Benni Mack commented and changed status
NewAccepted <span data-processor="relativetime" data-value="2021-12-14T14:35:28+00:00" > 12/14/21, 14:35 </span> -
Devid Messner commented <span data-processor="relativetime" data-value="2021-12-16T07:30:19+00:00" > 12/16/21, 07:30 </span>
Benni Mack wrote in #note-1:
> Hey Devid,
>
> yes. I can already imagine why this is the case. The issue is that the hide/unhide works, but as soon as you hit the save button, the form (POST data) is submitted and the value of the checkbox/toggle field is used, overriding the previous action.Hey,
Yes probably. Another interesting behavior is,
that if the “Hidden” field does not have the “invertStateDisplay” set, the actions may be reversed. Depending on the initial value of the hidden field, when the hidden button in the icon bar is activated, the field in the form is deactivated. Thus the status of the two buttons is no longer syncron. -
Ralph Pöllath commented <span data-processor="relativetime" data-value="2022-05-04T09:58:33+00:00" > 05/04/22, 09:58 </span>
@Devid Messner
I had the same problem. Thanks for the tip. -
Sascha Zander commented and changed attached debugging_process_cmdmap.png <span data-processor="relativetime" data-value="2022-08-04T09:32:08+00:00" > 08/04/22, 09:32 </span>
@Benni Mack
On my TYPO3 10.4.30 Projects i have the same issue but i don’t have the “hidden”-field in the show list of the IRRE TCA.
If i debugg the \TYPO3\CMS\Core\DataHandling\DataHandler::process_cmdmap and if i check the value of the IRRE in “$this->cmdmap” the “hidden”-field is only set on the items that has not open by the editor. On the items that was open it is missing the “hidden”-field and his new value. -
Daniel Hoffmann commented <span data-processor="relativetime" data-value="2022-08-08T15:35:55+00:00" > 08/08/22, 15:35 </span>
I have done some research:
*When the IRRE item is NOT expanded*
the switch works as expected.*When the IRRE item is expanded and the hidden toggle is not shown in the expanded area*
it is not possible to change the state of the expanded IRRE item*When the IRRE item is expanded and the hidden toggle is shown with renderType ‘checkboxToggle’ and invertStateDisplay = false*
it is possible to use both toggles and everything works fine, but for the editor it is difficult, because the switch in the “Header-Bar” shows the inverted State of the switch in the “Content-Area” of the irre Item*When the IRRE item is expanded and the hidden toggle is shown with renderType ‘checkboxToggle’ and invertStateDisplay = true*
The toggle in the expanded area works like expected.
The toggle in the “Header-Bar” does not workI tried to find the bug and fix it, but ended up in some javascript, where my knowledge is not very high.
I think the problem is the click event on the toggle in the “Header-Bar”, it does not recognize the invertedState of the button in the “Content-Area” and changes the value not correct then.
-
Peter Wimmer commented <span data-processor="relativetime" data-value="2022-08-31T14:19:51+00:00" > 08/31/22, 14:19 </span>
As an additional comment / temporary improvement:
I changed the TCA for the hidden field to “check” and “invertStateDisplay” = false. So the “hidden” input element looks like in older version, just a checkbox. This works.
$GLOBALS['TCA']['<TABLENAME>']['columns']['hidden']['config']['renderType'] = 'check'; $GLOBALS['TCA']['<TABLENAME>']['columns']['hidden']['config']['items'][0]['invertStateDisplay'] = false;
So it could be that there was no change in the javascript, it was just the change from “invertStateDisplay” false => true in TYPO3 11…
This fix will then most likely break again if a real fix is implemented. It should work, but most likely it will not.
-
Christian Buelter commented <span data-processor="relativetime" data-value="2022-09-20T14:09:23+00:00" > 09/20/22, 14:09 </span>
I had the same problem with mask elements.
That workaround helped. Thanks.Peter Wimmer wrote in #note-6:
> As an additional comment / temporary improvement:
>
> I changed the TCA for the hidden field to “check” and “invertStateDisplay” = false. So the “hidden” input element looks like in older version, just a checkbox. This works.
>
> […] -
websedit AG commented <span data-processor="relativetime" data-value="2022-11-07T07:28:05+00:00" > 11/07/22, 07:28 </span>
Hello everyone,
we are facing the same problem in one of our customer projectes.
Is it already foreseeable when a solution will be available?Kind regards!
-
Benni Mack changed Sprint Focus Stabilization Sprint <span data-processor="relativetime" data-value="2023-06-06T13:03:37+00:00" > 06/06/23, 13:03 </span>
-
Nick Aumann commented <span data-processor="relativetime" data-value="2023-12-01T12:07:30+00:00" > 12/01/23, 12:07 </span>
Is work on the bug planned? Will there be a patch for it?
See it on sprint board https://forger.typo3.com/sprint/core/9
-
Ulrich Mathes commented <span data-processor="relativetime" data-value="2024-02-19T14:54:56+00:00" > 02/19/24, 14:54 </span>
Still a problem in TYPO3 12 and TYPO3 13
-
Fabian Haider commented <span data-processor="relativetime" data-value="2024-02-28T09:37:22+00:00" > 02/28/24, 09:37 </span>
Ulrich Mathes wrote in #note-11:
> Still a problem in TYPO3 12 and TYPO3 13I’m having the same issue on a customer project on TYPO3 11, hope there will be a solution soon!
-
Nikita Hovratov changed Duplicated by #103482 <span data-processor="relativetime" data-value="2024-03-29T18:52:09+00:00" > 03/29/24, 18:52 </span>
-
Jan Kornblum commented <span data-processor="relativetime" data-value="2024-04-08T09:04:32+00:00" > 04/08/24, 09:04 </span>
I can confirm the problem exists in 11 LTS. Toggle the “hide” button within the inline elements header bar (inline element collapsed) does not work. Directly toggle the “hide” button within the expanded child content area works instead. In my case there is “ ‘invertStateDisplay’ => true”. Should be fixed soon!
-
Fabian Haider commented and changed TYPO3 Version
1112 PHP Version7.48.2 <span data-processor="relativetime" data-value="2024-07-16T12:01:59+00:00" > 07/16/24, 12:01 </span>updated the project to TYPO3 12.4 and i can confirm that the problem still exists to this day
-
Fabian Haider changed TYPO3 Version
1211 PHP Version8.27.4 <span data-processor="relativetime" data-value="2024-07-17T07:16:20+00:00" > 07/17/24, 07:16 </span> -
Philipp Gollmer commented <span data-processor="relativetime" data-value="2024-08-14T09:06:26+00:00" > 08/14/24, 09:06 </span>
I can confirm same behavior still in v13.2.1 (PHP 8.3)
Used invertStateDisplay true
collapsed element => works
expanded element => does not work
-
Georg Ringer changed Related to #105677 <span data-processor="relativetime" data-value="2024-11-24T19:18:00+00:00" > 11/24/24, 19:18 </span>
-
Ingo Hollmann commented <span data-processor="relativetime" data-value="2024-12-13T14:30:26+00:00" > 12/13/24, 14:30 </span>
I have this problem too, and it annoys our customer.
So i had to dig a little bit and it seems the problem lies on the invert state which is noch checked here:
https://github.com/TYPO3/typo3/blob/main/Build/Sources/TypeScript/backend/form-engine/container/inline-control-container.ts#L434I hat to Fix this, so here is a patch that works for TYPO3 v11.5, it’s not the best but it works. Maybe someone kann use this as base for a fix
diff --git a/Build/Sources/TypeScript/backend/Resources/Public/TypeScript/FormEngine/Container/InlineControlContainer.ts b/Build/Sources/TypeScript/backend/Resources/Public/TypeScript/FormEngine/Container/InlineControlContainer.ts index eac224ea5ee..1738aceaef2 100644 --- a/Build/Sources/TypeScript/backend/Resources/Public/TypeScript/FormEngine/Container/InlineControlContainer.ts +++ b/Build/Sources/TypeScript/backend/Resources/Public/TypeScript/FormEngine/Container/InlineControlContainer.ts @@ -41,6 +41,7 @@ enum Selectors { revertUniqueness = '.t3js-revert-unique', controlContainer = '.t3js-inline-controls', controlTopOuterContainer = '.t3js-inline-controls-top-outer-container', + recordHiddenInput = '[type="hidden"][name$="][hidden]"]', } enum States { @@ -260,6 +261,7 @@ class InlineControlContainer { this.registerSynchronizeLocalize(); this.registerRevertUniquenessAction(); this.registerToggle(); + this.registerToggelVisibility(); this.registerCreateRecordBySelector(); this.registerUniqueSelectFieldChanged(); @@ -420,10 +422,26 @@ class InlineControlContainer { const hiddenFieldName = 'data' + recordContainer.dataset.fieldName + '[' + target.dataset.hiddenField + ']'; const hiddenValueCheckBox = <HTMLInputElement>document.querySelector('[data-formengine-input-name="' + hiddenFieldName + '"'); const hiddenValueInput = <HTMLInputElement>document.querySelector('[name="' + hiddenFieldName + '"'); + const hiddenValueInputChangeItems = JSON.parse(hiddenValueCheckBox.getAttribute('data-formengine-field-change-items')); + let invert = false; + + if (hiddenValueInputChangeItems) { + hiddenValueInputChangeItems.forEach((i: any) => { + if (i.name == 'typo3-backend-form-update-bitmask' && i.invert == 'true') { + invert = true; + } + }); + } else { + invert = true; + } if (hiddenValueCheckBox !== null && hiddenValueInput !== null) { hiddenValueCheckBox.checked = !hiddenValueCheckBox.checked; - hiddenValueInput.value = hiddenValueCheckBox.checked ? '1' : '0'; + if (invert) { + hiddenValueInput.value = hiddenValueCheckBox.checked ? '1' : '0'; + } else { + hiddenValueInput.value = hiddenValueCheckBox.checked ? '0' : '1'; + } FormEngineValidation.markFieldAsChanged(hiddenValueCheckBox); } @@ -549,6 +567,29 @@ class InlineControlContainer { }).delegateTo(this.container, Selectors.revertUniqueness); } + private registerToggelVisibility () { + const me = this; + new RegularEvent('change', function(this: HTMLElement, e: Event) { + const recordContainer = this.closest('[data-object-id]'); + const containerHiddenToggleBtn = <HTMLButtonElement>recordContainer.querySelector(Selectors.enableDisableRecordButtonSelector) + const hiddenClass = 't3-form-field-container-inline-hidden'; + const isHidden = recordContainer.classList.contains(hiddenClass); + let toggleIcon: string; + + if (isHidden) { + toggleIcon = 'actions-edit-hide'; + recordContainer.classList.remove(hiddenClass); + } else { + toggleIcon = 'actions-edit-unhide'; + recordContainer.classList.add(hiddenClass); + } + + Icons.getIcon(toggleIcon, Icons.sizes.small).then((markup: string): void => { + containerHiddenToggleBtn.replaceChild(document.createRange().createContextualFragment(markup), containerHiddenToggleBtn.querySelector('.t3js-icon')); + }); + }).delegateTo(this.container, Selectors.recordHiddenInput); + } + /** * @param {string} objectId */ @@ -579,6 +620,30 @@ class InlineControlContainer { FormEngineValidation.initializeInputFields(); FormEngineValidation.validate(this.container); + // Check hidden state of th Container and update the element if neccessary + const inlineRecordContainerIsHidden = recordContainer.classList.contains('t3-form-field-container-inline-hidden'); + const containerHiddenToggleBtn = <HTMLButtonElement>recordContainer.querySelector(Selectors.enableDisableRecordButtonSelector) + const hiddenFieldName = 'data' + recordContainer.dataset.fieldName + '[' + containerHiddenToggleBtn.dataset.hiddenField + ']'; + const hiddenValueCheckBox = <HTMLInputElement>recordFieldsContainer.querySelector('[data-formengine-input-name="' + hiddenFieldName + '"'); + const hiddenValueInput = <HTMLInputElement>recordFieldsContainer.querySelector('[name="' + hiddenFieldName + '"'); + const hiddenValueInputChangeItems = JSON.parse(hiddenValueCheckBox.getAttribute('data-formengine-field-change-items')); + let invert = false; + hiddenValueInputChangeItems?.forEach((i: any) => { + if (i.name == 'typo3-backend-form-update-bitmask' && i.invert == 'true') { + invert = true; + } + }); + + if (inlineRecordContainerIsHidden != (hiddenValueInput.value == (invert ? '0' : '1'))) { + hiddenValueCheckBox.checked = !hiddenValueCheckBox.checked; + if (invert) { + hiddenValueInput.value = hiddenValueCheckBox.checked ? '1' : '0'; + } else { + hiddenValueInput.value = hiddenValueCheckBox.checked ? '0' : '1'; + } + FormEngineValidation.markFieldAsChanged(hiddenValueCheckBox); + } + if (this.hasObjectGroupDefinedUniqueConstraints()) { const recordContainer = InlineControlContainer.getInlineRecordContainer(objectId); this.removeUsed(recordContainer); -
Garvin Hicking changed Related to #105341 <span data-processor="relativetime" data-value="2024-12-17T20:05:39+00:00" > 12/17/24, 20:05 </span>
-
Torben Hansen changed Duplicates #105949 <span data-processor="relativetime" data-value="2025-01-16T15:12:59+00:00" > 01/16/25, 15:12 </span>
-
Torben Hansen changed
Duplicates #105949<span data-processor="relativetime" data-value="2025-01-16T15:13:22+00:00" > 01/16/25, 15:13 </span> -
Torben Hansen changed Duplicated by #105949 <span data-processor="relativetime" data-value="2025-01-16T15:13:48+00:00" > 01/16/25, 15:13 </span>
-
Garvin Hicking commented and changed attached ref-hiding-collapsed-working.gif attached ref-hiding-expanded-notworking.gif TYPO3 Version
1112 Complexity hard <span data-processor="relativetime" data-value="2025-03-15T00:03:44+00:00" > 03/15/25, 00:03 </span>Current POC: https://review.typo3.org/c/Packages/TYPO3.CMS/+/88305 (fixes it for IRRE records, but not yet IRRE file references)
Video of this attached.
-
Nikita Hovratov changed Related to #106786 <span data-processor="relativetime" data-value="2025-05-28T09:28:05+00:00" > 05/28/25, 09:28 </span>
-
Garvin Hicking changed Duplicated by #107157 <span data-processor="relativetime" data-value="2025-07-28T15:10:07+00:00" > 07/28/25, 15:10 </span>
-
Garvin Hicking changed Related to #107295 <span data-processor="relativetime" data-value="2025-08-15T12:52:08+00:00" > 08/15/25, 12:52 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 92362 status
AcceptedUnder Review <span data-processor="relativetime" data-value="2026-01-17T05:34:06+00:00" > 01/17/26, 05:34 </span> -
Gerrit Code Review pushed patch set 2 for main to change 92362 <span data-processor="relativetime" data-value="2026-01-17T05:35:12+00:00" > 01/17/26, 05:35 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 92362 <span data-processor="relativetime" data-value="2026-01-17T05:37:26+00:00" > 01/17/26, 05:37 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 92362 <span data-processor="relativetime" data-value="2026-01-17T06:55:37+00:00" > 01/17/26, 06:55 </span>
-
Henrik Ziegenhain commented <span data-processor="relativetime" data-value="2026-03-31T10:47:37+00:00" > 03/31/26, 10:47 </span>
It is still an issue on v14.1
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2026-03-31T17:06:05+00:00" > 03/31/26, 17:06 </span>
Yes, also on 14.2
-
Garvin Hicking changed Duplicated by #109455 <span data-processor="relativetime" data-value="2026-04-01T13:03:49+00:00" > 04/01/26, 13:03 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 92362 <span data-processor="relativetime" data-value="2026-04-14T19:09:32+00:00" > 04/14/26, 19:09 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 92362 <span data-processor="relativetime" data-value="2026-04-23T08:16:38+00:00" > 04/23/26, 08:16 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 93817 <span data-processor="relativetime" data-value="2026-04-23T08:22:24+00:00" > 04/23/26, 08:22 </span>
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2026-04-23T12:09:06+00:00" > 04/23/26, 12:09 </span>
@Everyone: Please check out https://review.typo3.org/c/Packages/TYPO3.CMS/+/92362 for the recent version of a patch that at least for me seems to do the trick
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 93829 <span data-processor="relativetime" data-value="2026-04-23T13:11:48+00:00" > 04/23/26, 13:11 </span>
-
Benjamin Franzke commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-04-23T14:10:12+00:00" > 04/23/26, 14:10 </span>Applied in changeset commit:b5bb5fc8ed08ed279c9264c42d4aa500ff976643.
-
Benni Mack changed Related to #100471 <span data-processor="relativetime" data-value="2026-05-04T16:46:49+00:00" > 05/04/26, 16:46 </span>
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2026-08-11T08:46:35+00:00" > 08/11/26, 08:46 </span>
Hey Devid,
yes. I can already imagine why this is the case. The issue is that the hide/unhide works, but as soon as you hit the save button, the form (POST data) is submitted and the value of the checkbox/toggle field is used, overriding the previous action.