From 5a4d277c9f9805ac88eedbd32ddc9b97a188022a Mon Sep 17 00:00:00 2001 From: Oliver Eglseder Date: Thu, 23 May 2024 10:59:21 +0200 Subject: [PATCH 1/6] [BUGFIX] Cast pageuid to integer to build the preview URL Resolves: https://projekte.in2code.de/issues/63758 --- .../DataBender/RedirectSourceHostReplacement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Features/RedirectsSupport/DataBender/RedirectSourceHostReplacement.php b/Classes/Features/RedirectsSupport/DataBender/RedirectSourceHostReplacement.php index 382465d37..738b1aca6 100644 --- a/Classes/Features/RedirectsSupport/DataBender/RedirectSourceHostReplacement.php +++ b/Classes/Features/RedirectsSupport/DataBender/RedirectSourceHostReplacement.php @@ -113,7 +113,7 @@ public function replaceLocalWithForeignSourceHost(RecordWasSelectedForPublishing $coreLinkService = GeneralUtility::makeInstance(LinkService::class); $linkAttributes = $coreLinkService->resolveByStringRepresentation($target); if (!empty($linkAttributes['pageuid'])) { - $url = BackendUtility::buildPreviewUri('pages', $linkAttributes['pageuid'], 'foreign'); + $url = BackendUtility::buildPreviewUri('pages', (int)$linkAttributes['pageuid'], 'foreign'); if (null === $url) { return; } From 9f2010c4cce23b0984b7974d4cb29ce6a9910784 Mon Sep 17 00:00:00 2001 From: Daniel Hoffmann Date: Mon, 27 May 2024 09:05:39 +0200 Subject: [PATCH 2/6] [META] Exclude compile-sass from archive --- .gitattributes | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/.gitattributes b/.gitattributes index 724a0b2b8..d29c22fae 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,25 +1,26 @@ # .gitattributes -/.github export-ignore -/.project export-ignore -/Build export-ignore -.gitkeep export-ignore -/.editorconfig export-ignore -/.env export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore -/.phpstorm.meta.php export-ignore -/.eslintrc export-ignore -/.travis.yml export-ignore -/Resources/Private/Sass export-ignore -/Resources/Private/config.rb export-ignore -/Resources/Private/Clickdummy export-ignore -/Tests export-ignore -/Makefile export-ignore -/phive.xml export-ignore -/phpunit.browser.xml export-ignore -/phpunit.functional.xml export-ignore -/phpunit.unit.xml export-ignore +/.github export-ignore +/.project export-ignore +/Build export-ignore +.gitkeep export-ignore +/.editorconfig export-ignore +/.env export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/.phpstorm.meta.php export-ignore +/.eslintrc export-ignore +/.travis.yml export-ignore +/Resources/Private/Sass export-ignore +/Resources/Private/compile-sass.sh export-ignore +/Resources/Private/config.rb export-ignore +/Resources/Private/Clickdummy export-ignore +/Tests export-ignore +/Makefile export-ignore +/phive.xml export-ignore +/phpunit.browser.xml export-ignore +/phpunit.functional.xml export-ignore +/phpunit.unit.xml export-ignore /Tests/Browser/files/* filter=lfs diff=lfs merge=lfs -text /Tests/Manual/images/* filter=lfs diff=lfs merge=lfs -text From 309d4cc9c14de9a6eaf064de878101e8f1f61d73 Mon Sep 17 00:00:00 2001 From: Oliver Eglseder Date: Mon, 27 May 2024 10:07:10 +0200 Subject: [PATCH 3/6] [BUGFIX] Discard the table portion of a joined row if the joined record does not exist Resolves: https://projekte.in2code.de/issues/60303 Resolves: https://projekte.in2code.de/issues/64064 --- .../Component/Core/DemandResolver/Join/JoinDemandResolver.php | 2 +- .../Component/Core/Repository/SingleDatabaseRepository.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Classes/Component/Core/DemandResolver/Join/JoinDemandResolver.php b/Classes/Component/Core/DemandResolver/Join/JoinDemandResolver.php index 4db28e2ca..7660e9df0 100644 --- a/Classes/Component/Core/DemandResolver/Join/JoinDemandResolver.php +++ b/Classes/Component/Core/DemandResolver/Join/JoinDemandResolver.php @@ -135,7 +135,7 @@ protected function createAndMapMmRecords( if (null === $mmRecord) { continue; } - if (!empty($row['local']['table']) || !empty($row['foreign']['table'])) { + if (!empty($row['local']['table']['uid']) || !empty($row['foreign']['table']['uid'])) { $uid = $row['local']['table']['uid'] ?? $row['foreign']['table']['uid']; $tableRecord = $this->recordIndex->getRecord($table, $uid); if (null === $tableRecord) { diff --git a/Classes/Component/Core/Repository/SingleDatabaseRepository.php b/Classes/Component/Core/Repository/SingleDatabaseRepository.php index 19bb59ca3..7e40ccc85 100644 --- a/Classes/Component/Core/Repository/SingleDatabaseRepository.php +++ b/Classes/Component/Core/Repository/SingleDatabaseRepository.php @@ -12,6 +12,7 @@ use TYPO3\CMS\Core\Database\Query\QueryHelper; use function array_column; +use function array_key_exists; use function hash; use function json_encode; use function substr; @@ -139,6 +140,9 @@ public function findByPropertyWithJoin( // Split the prefix into mmtbl/table (0-5) and the actual column name (6-X). $splitRow[substr($column, 0, 5)][substr($column, 6)] = $value; } + if (array_key_exists('uid', $splitRow['table']) && null === $splitRow['table']['uid']) { + unset($splitRow['table']); + } $mmIdentityProperties = [ $splitRow['mmtbl']['uid_local'], $splitRow['mmtbl']['uid_foreign'], From b2bf7e9160be4f90dd1466942ff0df93ac34bf8f Mon Sep 17 00:00:00 2001 From: Oliver Eglseder Date: Mon, 27 May 2024 10:19:19 +0200 Subject: [PATCH 4/6] [DOCS] Add known issue to explain missing (orphaned) MM records in the record tree Resolves: https://projekte.in2code.de/issues/60303 Resolves: https://projekte.in2code.de/issues/64064 --- Documentation/KnownIssues.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/KnownIssues.md b/Documentation/KnownIssues.md index 3bafe073b..01aefec43 100644 --- a/Documentation/KnownIssues.md +++ b/Documentation/KnownIssues.md @@ -19,3 +19,18 @@ that the context menu entry does not know about all conditions which have to be The context menu is created if the current user is allowed to publish and 3rd party integrations allow the publishing of this page. The context menu entry does not take into account if the record is actually changed. Publishing a page which has no changes will result in the message "This record is not yet publishable". + +## Orphaned MM records are ignored if foreign_table_where includes condition to joined table + +Preconditions: + +* You have a TCA select/inline relation with an MM table +* The column config defines an extra `foreign_table_where` +* The `foreign_table_where` contains a constraint on the foreign_table + +When there are orphaned MM records, which means that the `uid_foreign` of the MM table points to a record in the joined +table which does not exist, the JOIN query will not return any result, hence the MM record is not fetched from the +database. This will not make a difference in most cases, as TYPO3 uses the same JOIN query to select records, but can +lead to differences if custom queries or code is used to handle MM records. Anyway, these orphaned MM records are +invalid and should be deleted. The community extension https://github.com/lolli42/dbdoctor has shown to be effective. +Manual operation might still be required though. From df1342a9a37ee6c53eb0c9bc4c2c7f9c5f5f85ee Mon Sep 17 00:00:00 2001 From: Daniel Hoffmann Date: Tue, 28 May 2024 11:36:16 +0200 Subject: [PATCH 5/6] [META] Set the EM conf version number to 12.5.2 --- ext_emconf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext_emconf.php b/ext_emconf.php index a7a01d7f5..2e97cf9cc 100755 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -9,7 +9,7 @@ 'title' => 'in2publish Core', 'description' => 'Content publishing extension to connect stage and production server', 'category' => 'plugin', - 'version' => '12.5.1', + 'version' => '12.5.2', 'state' => 'stable', 'clearCacheOnLoad' => true, 'author' => 'Alex Kellner, Oliver Eglseder, Thomas Scheibitz, Stefan Busemann', From 9c10cd46973527ce5ec0ded3fe116b8375e32c89 Mon Sep 17 00:00:00 2001 From: Daniel Hoffmann Date: Tue, 28 May 2024 11:36:40 +0200 Subject: [PATCH 6/6] [DOCS] Update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89ec719bd..1d4d5d2db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # In2publish Core Change Log +12.5.2: +- [DOCS] Add known issue to explain missing (orphaned) MM records in the record tree +- [BUGFIX] Discard the table portion of a joined row if the joined record does not exist +- [META] Exclude compile-sass from archive +- [BUGFIX] Cast pageuid to integer to build the preview URL + 12.5.1: - [BUGFIX] Correct evaluation of publishing state - [BUGFIX] Fixes Databender for Redirects