Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested and hidden/disabled mask content elements not visible in backend preview #620

Closed
Wintermilch opened this issue Feb 21, 2024 · 1 comment

Comments

@Wintermilch
Copy link

Using TYPO3 12.4.10 and Mask 8.3.8

I'm using custom templates for the backend preview of my mask elements.
In these previews I'm also showing the nested/child elements.

Now if any element has nested elements, the preview works fine.
Example:
image

But if I hide a nested record, it'll disappear but it shows up in the edit view. (it is not deleted):
image

I've searched through the code and found why this does not work.
Inside the InlineHelper class I've found this line which checks if we are in work space preview mode:

$inWorkspacePreviewMode = $workspaceId > 0;

But in the page module the workspace id is 0. So changing the condition to $workSpaceId >= 0; will then remove the querybuilder restrictions some lines later.

Then in this line the condition for the disabled field had to be removed in order not continue the loop.

if ($element === null || ($element[$GLOBALS['TCA'][$childTable]['ctrl']['enablecolumns']['disabled']] ?? false)) {

With these 2 adjustments, my preview works fine again:
image

NOTE: This does not happen if nested element is from tt_content table.

@nhovratov
Copy link
Collaborator

@Wintermilch I had the false assumption back then that hidden records should not be displayed in backend previews. This is now fixed.

NOTE: This does not happen if nested element is from tt_content table.

Yes! This is because they are handled differentely (better) than Inline fields. This should ideally be unified so everything behaves identically. This is a very legacy part of the Mask Code. However, my focus is currently on Content Blocks and I won't be doing larger refactorings of the Mask Code for the forseeable future.

nhovratov added a commit that referenced this issue Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants