|
13 | 13 | use TYPO3\CMS\Backend\Utility\BackendUtility; |
14 | 14 | use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; |
15 | 15 | use TYPO3\CMS\Core\Utility\GeneralUtility; |
| 16 | +use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper; |
16 | 17 |
|
17 | 18 | /** |
18 | 19 | * Time table builder service. |
@@ -42,18 +43,27 @@ public function getTimeTablesByConfigurationIds(array $ids, int $workspace): arr |
42 | 43 |
|
43 | 44 | foreach ($ids as $configurationUid) { |
44 | 45 | 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). |
45 | 51 | $row = BackendUtility::getRecord('tx_calendarize_domain_model_configuration', $configurationUid); |
| 52 | + if (!\is_array($row)) { |
| 53 | + continue; |
| 54 | + } |
46 | 55 | 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; |
49 | 58 | } |
| 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); |
50 | 65 | } |
51 | 66 |
|
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; |
57 | 67 | if (!($configuration instanceof Configuration)) { |
58 | 68 | continue; |
59 | 69 | } |
|
0 commit comments