Skip to content

Commit 1eada42

Browse files
committed
fix: Avoid problems with workspace overlays of the configuration in v14 - incl. v13
1 parent 2c4c056 commit 1eada42

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

Classes/Service/TimeTableService.php

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use TYPO3\CMS\Backend\Utility\BackendUtility;
1414
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
1515
use TYPO3\CMS\Core\Utility\GeneralUtility;
16+
use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper;
1617

1718
/**
1819
* Time table builder service.
@@ -42,18 +43,27 @@ public function getTimeTablesByConfigurationIds(array $ids, int $workspace): arr
4243

4344
foreach ($ids as $configurationUid) {
4445
if ($workspace) {
46+
// Load the configuration incl. its workspace overlay and map the raw record
47+
// directly: since TYPO3 v14 the Extbase query parser always excludes offline
48+
// versions (t3ver_oid != 0), so versioned configurations can no longer be
49+
// fetched via the repository (the former $GLOBALS['TCA'][...]['versioningWS']
50+
// runtime toggle is ignored, the workspace state comes from the TcaSchemaFactory).
4551
$row = BackendUtility::getRecord('tx_calendarize_domain_model_configuration', $configurationUid);
52+
if (!\is_array($row)) {
53+
continue;
54+
}
4655
BackendUtility::workspaceOL('tx_calendarize_domain_model_configuration', $row, $workspace);
47-
if (isset($row['_ORIG_uid'])) {
48-
$configurationUid = (int)$row['_ORIG_uid'];
56+
if (!\is_array($row)) {
57+
continue;
4958
}
59+
60+
$dataMapper = GeneralUtility::makeInstance(DataMapper::class);
61+
$configuration = $dataMapper->map(Configuration::class, [$row])[0] ?? null;
62+
} else {
63+
// Do not use DI for repo to avoid problem in ext_localconf.php loading context
64+
$configuration = $this->configurationRepository->findByUid($configurationUid);
5065
}
5166

52-
// Disable Workspace for selection to get also offline versions of configuration
53-
$GLOBALS['TCA']['tx_calendarize_domain_model_configuration']['ctrl']['versioningWS'] = false;
54-
// Do not use DI for repo to avoid problem in ext_localconf.php loading context
55-
$configuration = $this->configurationRepository->findByUid($configurationUid);
56-
$GLOBALS['TCA']['tx_calendarize_domain_model_configuration']['ctrl']['versioningWS'] = true;
5767
if (!($configuration instanceof Configuration)) {
5868
continue;
5969
}

0 commit comments

Comments
 (0)