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

The child element of the container is not visible in the Workspace; when in Live the child elements are hidden #485

Closed
sivaprasad1988 opened this issue Mar 18, 2024 · 4 comments · Fixed by #555 · May be fixed by #554
Closed
Assignees

Comments

@sivaprasad1988
Copy link

Dear Team,

I would like to bring a minor issue to your attention regarding the container and workspace setup. Currently, within a container, there are three child elements. In the LIVE Workspace, both the container and its child elements are hidden. However, in the Workspace backend, both the container and the elements are visible. However, when viewed in the frontend, only the container appears while the elements remain hidden.

It's worth noting that toggling back to the Live Workspace, enabling the child elements while keeping the container hidden, and then switching back to the Workspace results in the elements becoming visible.

Could you please confirm if this behavior is intended?

Best regards,

@sivaprasad1988
Copy link
Author

If I add HiddenRestriction, then it works fine. Please feel free to ignore if this is wrong.

===================================================================
diff --git a/cms/app/public/typo3conf/ext/container/Classes/Domain/Factory/Database.php b/cms/app/public/typo3conf/ext/container/Classes/Domain/Factory/Database.php
--- a/cms/app/public/typo3conf/ext/container/Classes/Domain/Factory/Database.php	
+++ b/cms/app/public/typo3conf/ext/container/Classes/Domain/Factory/Database.php	(date 1710751654818)
@@ -20,6 +20,7 @@
 use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
 use TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer;
 use TYPO3\CMS\Core\Database\Query\Restriction\FrontendWorkspaceRestriction;
+use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction;
 use TYPO3\CMS\Core\Database\Query\Restriction\WorkspaceRestriction;
 use TYPO3\CMS\Core\Http\ApplicationType;
 use TYPO3\CMS\Core\Http\ServerRequest;
@@ -55,6 +56,7 @@
             // do not use FrontendWorkspaceRestriction
             $queryBuilder->getRestrictions()
                 ->removeByType(FrontendWorkspaceRestriction::class)
+                ->removeByType(HiddenRestriction::class)
                 ->add(GeneralUtility::makeInstance(WorkspaceRestriction::class, $this->workspaceId));
         } else {
             $queryBuilder->getRestrictions()

@599media
Copy link

We can confirm this behavior in b13/container v3.0.0 with TYPO3 12.4.22.

However, the patch seems to fix the issue, but does not work with container v3.0.0 since there was a TYPO3 condition added by cd989aa (see https://github.com/b13/container/blob/master/Classes/Domain/Factory/Database.php#L54). I don't see the reason from the commit message. If you change the version constraint to "< 13" the patch works as expected.

The working patch vor v3.0.0 (for TYPO3 v12) would be:

@@ -20,6 +20,7 @@
 use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
 use TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer;
 use TYPO3\CMS\Core\Database\Query\Restriction\FrontendWorkspaceRestriction;
+use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction;
 use TYPO3\CMS\Core\Database\Query\Restriction\WorkspaceRestriction;
 use TYPO3\CMS\Core\Http\ApplicationType;
 use TYPO3\CMS\Core\Information\Typo3Version;
@@ -51,10 +52,11 @@
             && ApplicationType::fromRequest($this->getServerRequest())->isFrontend()
         ) {
             $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
-            if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() < 12) {
+            if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() < 13) {
                 // do not use FrontendWorkspaceRestriction
                 $queryBuilder->getRestrictions()
                     ->removeByType(FrontendWorkspaceRestriction::class)
+		     ->removeByType(HiddenRestriction::class)
                     ->add(GeneralUtility::makeInstance(WorkspaceRestriction::class, $this->workspaceId));
             }
         } else {

We did not test this on TYPO3 v13.x.

Maybe @achimfritz / @achimfritz-b13 could have a look.

@achimfritz achimfritz self-assigned this Nov 5, 2024
@sivaprasad1988
Copy link
Author

@achimfritz May I change it or do you want to do this

@achimfritz
Copy link
Contributor

we will additional need some (one?) test, for this use-case, and make sure all other tests still run. you may change it ....

sivaprasad1988 pushed a commit to sivaprasad1988/container that referenced this issue Nov 8, 2024
Tasks:
* Resolve the issue where the child element of the container is not visible in the Workspace view; however, in the Live view, the child elements remain hidden.

Resolves: b13#485
achimfritz added a commit that referenced this issue Nov 9, 2024
achimfritz added a commit that referenced this issue Nov 28, 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
3 participants