Skip to content

Commit af4c06d

Browse files
axel.seemann@netresearch.demschwemer
authored andcommitted
[BUGFIX] Backend form selector and module must not apply frontend enable column restrictions
Forms with starttime/endtime set were invisible in both the plugin FlexForm selector and the Powermail backend module because TYPO3's default query restrictions and Extbase enable-field handling applied frontend visibility rules to backend queries. FormSelectorUserFunc::getAllForms(): Remove StartTimeRestriction and EndTimeRestriction from the QueryBuilder so forms with a frontend visibility window remain selectable when an editor configures a powermail content element. Hidden forms are intentionally still filtered here (a hidden form should not be selectable in the plugin). FormRepository::findAll() and findAllInPidAndRootline(): Add setIgnoreEnableFields(true)->setEnableFieldsToBeIgnored(['disabled', 'starttime', 'endtime']) so all forms — including hidden and time-restricted ones — appear in the backend module overview. This allows editors to hide/unhide and inspect forms regardless of their current frontend visibility state. The root cause in both cases is that starttime, endtime and hidden are frontend visibility controls registered in TCA enablecolumns. They must not prevent backend users from accessing or managing form records.
1 parent a25123c commit af4c06d

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

Classes/Domain/Repository/FormRepository.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ public function getPagesValue(int $uid): string
9595
public function findAll()
9696
{
9797
$query = $this->createQuery();
98-
$query->getQuerySettings()->setRespectStoragePage(false);
98+
$query->getQuerySettings()
99+
->setRespectStoragePage(false)
100+
->setIgnoreEnableFields(true)
101+
->setEnableFieldsToBeIgnored(['disabled', 'starttime', 'endtime']);
99102
return $query->execute();
100103
}
101104

@@ -108,7 +111,10 @@ public function findAll()
108111
public function findAllInPidAndRootline(int $pid): QueryResultInterface
109112
{
110113
$query = $this->createQuery();
111-
$query->getQuerySettings()->setRespectStoragePage(false);
114+
$query->getQuerySettings()
115+
->setRespectStoragePage(false)
116+
->setIgnoreEnableFields(true)
117+
->setEnableFieldsToBeIgnored(['disabled', 'starttime', 'endtime']);
112118

113119
if ($pid > 0) {
114120
$queryGenerator = GeneralUtility::makeInstance(QueryGenerator::class);

Classes/Tca/FormSelectorUserFunc.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
use In2code\Powermail\Utility\BackendUtility;
1313
use In2code\Powermail\Utility\DatabaseUtility;
1414
use TYPO3\CMS\Backend\Utility\BackendUtility as BackendUtilityCore;
15+
use TYPO3\CMS\Core\Database\Query\Restriction\EndTimeRestriction;
16+
use TYPO3\CMS\Core\Database\Query\Restriction\StartTimeRestriction;
1517
use TYPO3\CMS\Core\Utility\ArrayUtility;
1618
use TYPO3\CMS\Core\Utility\GeneralUtility;
1719

@@ -111,6 +113,11 @@ protected function getStartPids(): array
111113
protected function getAllForms(int $startPid, int $language): array
112114
{
113115
$queryBuilder = DatabaseUtility::getQueryBuilderForTable(Form::TABLE_NAME);
116+
// Remove frontend-only time restrictions so forms with starttime/endtime
117+
// remain selectable in the backend plugin configuration regardless of their
118+
// frontend visibility window.
119+
$queryBuilder->getRestrictions()->removeByType(StartTimeRestriction::class);
120+
$queryBuilder->getRestrictions()->removeByType(EndTimeRestriction::class);
114121
return $queryBuilder
115122
->select('*')
116123
->from(Form::TABLE_NAME)

0 commit comments

Comments
 (0)