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

Overwritten backend labels vanish if the element is hidden #203

Closed
ghost opened this issue Nov 28, 2018 · 0 comments
Closed

Overwritten backend labels vanish if the element is hidden #203

ghost opened this issue Nov 28, 2018 · 0 comments

Comments

@ghost
Copy link

ghost commented Nov 28, 2018

TYPO3 v9.5.1, Mask v4.0.0

The labels of form inputs for mask elements is overwritten via (generated) TSConfig, using the user_mask_contentType userFunc to check the CType column. Unfortunately, the QueryBuilder for tt_content has the HiddenRestriction enabled by default, meaning that the content element is not found by a simple query if it is hidden.
As a result, the labels revert to the original value defined in TCA or blank for columns added via mask.

Relevant code:

$connection = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ConnectionPool::class)->getConnectionForTable('tt_content');

As I am writing the fix, it appears that the same shortcoming exists in user_mask_beLayout, and that in addition to the HiddenRestriction, the StartTimeRestriction and EndTimeRestriction are also added by default, for both pages and tt_content, meaning that editing the element/page outside of the enabled time frame would make mask fields vanish or have the wrong labels.

ghost pushed a commit to fwg/mask that referenced this issue Nov 28, 2018
…ernott#203

The default query restrictions in TYPO3 hide pages and content elements
that are hidden, or that have starttime and/or endtime set, and the
current time is outside of that time frame.

Mask uses a custom TSConfig conditional function that checks the
database for CType in case of tt_content, or backend_layout in case of
pages, to insert its own extended fields (pages) or set overridden
labels for inputs (tt_content).

This also adds a small static cache for the CType check to avoid
querying the database for each TSConfig conditional.
ghost pushed a commit to fwg/mask that referenced this issue Nov 28, 2018
…ott#203

The default query restrictions in TYPO3 hide pages and content elements
that are hidden, or that have starttime and/or endtime set, and the
current time is outside of that time frame.

Mask uses a custom TSConfig conditional function that checks the
database for CType in case of tt_content, or backend_layout in case of
pages, to insert its own extended fields (pages) or set overridden
labels for inputs (tt_content).

This also adds a small static cache for the CType check to avoid
querying the database for each TSConfig conditional.
@butu butu closed this as completed in #204 Dec 6, 2018
butu pushed a commit that referenced this issue Dec 6, 2018
The default query restrictions in TYPO3 hide pages and content elements
that are hidden, or that have starttime and/or endtime set, and the
current time is outside of that time frame.

Mask uses a custom TSConfig conditional function that checks the
database for CType in case of tt_content, or backend_layout in case of
pages, to insert its own extended fields (pages) or set overridden
labels for inputs (tt_content).

This also adds a small static cache for the CType check to avoid
querying the database for each TSConfig conditional.
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

0 participants