Commit 84948b2c authored by Christian Kuhn's avatar Christian Kuhn Committed by Richard Haeser

[TASK] No reference index for workspace delete placeholders

The reference index can be seen as a 'cache' for
consuming application parts other than the
DataHandler, which does not rely on it's state but
keeps it updated.

From this point of view, workspace delete placeholders
(t3ver_state=2 records) should not have reference
index entries: The delete placeholder is just a
marker that a specific live record is slated for
deletion upon publish. It does not carry relation
information on it's own.

The patch changes reference index code to not
consider relations for workspace delete placeholder
records.

Change-Id: I0a1fd490c4133e7ce92a53ebd4413cc7b43b1d58
Resolves: #93274
Releases: master
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67396Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarRichard Haeser <richard@richardhaeser.com>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: default avatarRichard Haeser <richard@richardhaeser.com>
parent fbdfea58
......@@ -28,6 +28,7 @@ use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\DataHandling\Event\IsTableExcludedFromReferenceIndexEvent;
use TYPO3\CMS\Core\Registry;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Versioning\VersionState;
/**
* Reference index processing and relation extraction
......@@ -303,6 +304,14 @@ class ReferenceIndex implements LoggerAwareInterface
*/
protected function generateDataUsingRecord(string $tableName, array $record): array
{
if (BackendUtility::isTableWorkspaceEnabled($tableName)) {
// Never write relations for t3ver_state = 2 delete placeholder records
$versionState = VersionState::cast($record['t3ver_state'] ?? 0);
if ($versionState->equals(VersionState::DELETE_PLACEHOLDER)) {
return [];
}
}
$this->relations = [];
// Get all relations from record:
$recordRelations = $this->getRelations($tableName, $record);
......
......@@ -54,7 +54,3 @@
,"5aa620d796bedb2df9724db6d47487f8","tt_content",331,"image",,,,1,0,"sys_file_reference",129,,,,,,,,
,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,,,
,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,,,
,"36f1ed8936df905a25f6454b259f05eb","sys_file_reference",130,"uid_local",,,,0,1,"sys_file",21,,,,,,,,
,"69bd4dfe47d34722a1668f50c7f2deaa","sys_file_reference",131,"uid_local",,,,0,1,"sys_file",1,,,,,,,,
,"4a9997099941b19dc087053b0d087362","tt_content",332,"image",,,,0,1,"sys_file_reference",130,,,,,,,,
,"6c3a5722561aa19faa40a7c7742f686b","tt_content",332,"image",,,,1,1,"sys_file_reference",131,,,,,,,,
......@@ -54,7 +54,5 @@
,"5aa620d796bedb2df9724db6d47487f8","tt_content",331,"image",,,,1,0,"sys_file_reference",129,,,,,,,,
,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,,,
,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,,,
,"9215daa3af61696d9d2d6aac0f624a63","sys_file_reference",130,"uid_local",,,,0,1,"sys_file",1,,,,,,,,
,"c0f878931452ab5b20a3198773f8e59e","sys_file_reference",131,"uid_local",,,,0,1,"sys_file",21,,,,,,,,
,"f098f1d38d94a2a30560ddac9c89f788","tt_content",332,"image",,,,0,1,"sys_file_reference",131,,,,,,,,
,"7c78b8e30579552db7f605e2c209ebb6","tt_content",332,"image",,,,1,1,"sys_file_reference",130,,,,,,,,
......@@ -55,6 +55,5 @@
,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,,,
,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,,,
,"9215daa3af61696d9d2d6aac0f624a63","sys_file_reference",130,"uid_local",,,,0,1,"sys_file",1,,,,,,,,
,"c0f878931452ab5b20a3198773f8e59e","sys_file_reference",131,"uid_local",,,,0,1,"sys_file",21,,,,,,,,
,"4a9997099941b19dc087053b0d087362","tt_content",332,"image",,,,0,1,"sys_file_reference",130,,,,,,,,
,"6c3a5722561aa19faa40a7c7742f686b","tt_content",332,"image",,,,1,1,"sys_file_reference",131,,,,,,,,
......@@ -33,5 +33,3 @@
,"8f3d6a0de293045066188fc790f4805f","tt_content",298,"tx_testdatahandler_group",,,,1,0,"tx_testdatahandler_element",3,,,,,,
,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
,"f8a45d275a837e9f88de3b571457196a","tt_content",299,"tx_testdatahandler_group",,,,0,1,"tx_testdatahandler_element",2,,,,,,
,"cf97d69b9929d23bc0ef8b8eadb92da3","tt_content",299,"tx_testdatahandler_group",,,,1,1,"tx_testdatahandler_element",3,,,,,,
......@@ -60,5 +60,3 @@
,"b3963a4f186e2a6a9f99f8bc56032e5b","tx_irretutorial_1ncsv_offer",6,"prices",,,,1,0,"tx_irretutorial_1ncsv_price",11,,,,,,
,"fe803b6ecad9e2f344d769915bef71b6","tx_irretutorial_1ncsv_offer",7,"prices",,,,0,0,"tx_irretutorial_1ncsv_price",12,,,,,,
,"4f04e32221eb9407dca98a1b356e3b25","tx_irretutorial_1ncsv_offer",8,"prices",,,,0,0,"tx_irretutorial_1ncsv_price",13,,,,,,
,"6bff896211ced53c56b5693cec93b085","tx_irretutorial_1ncsv_offer",11,"prices",,,,0,1,"tx_irretutorial_1ncsv_price",19,,,,,,
,"ecba35a75355bd60295dcbc3aa90c30b","tx_irretutorial_1ncsv_hotel",7,"offers",,,,0,1,"tx_irretutorial_1ncsv_offer",11,,,,,,
......@@ -61,6 +61,3 @@
,"b3963a4f186e2a6a9f99f8bc56032e5b","tx_irretutorial_1ncsv_offer",6,"prices",,,,1,0,"tx_irretutorial_1ncsv_price",11,,,,,,
,"fe803b6ecad9e2f344d769915bef71b6","tx_irretutorial_1ncsv_offer",7,"prices",,,,0,0,"tx_irretutorial_1ncsv_price",12,,,,,,
,"4f04e32221eb9407dca98a1b356e3b25","tx_irretutorial_1ncsv_offer",8,"prices",,,,0,0,"tx_irretutorial_1ncsv_price",13,,,,,,
,"f92216ac7261befdce6bc4918bf9824b","tx_irretutorial_1ncsv_offer",9,"prices",,,,0,1,"tx_irretutorial_1ncsv_price",14,,,,,,
,"8140fd8f74b30ebbb5e9c7ce429cf0a8","tx_irretutorial_1ncsv_hotel",6,"offers",,,,0,1,"tx_irretutorial_1ncsv_offer",9,,,,,,
,"caad2222956222fafe344085ab7393ef","tt_content",299,"tx_irretutorial_1ncsv_hotels",,,,0,1,"tx_irretutorial_1ncsv_hotel",6,,,,,,
......@@ -77,5 +77,3 @@
,"8140fd8f74b30ebbb5e9c7ce429cf0a8","tx_irretutorial_1ncsv_hotel",6,"offers",,,,0,1,"tx_irretutorial_1ncsv_offer",9,,,,,,
,"c340bd2ce9d75d6283580fedaefa9a30","tx_irretutorial_1ncsv_hotel",6,"offers",,,,1,1,"tx_irretutorial_1ncsv_offer",10,,,,,,
,"caad2222956222fafe344085ab7393ef","tt_content",299,"tx_irretutorial_1ncsv_hotels",,,,0,1,"tx_irretutorial_1ncsv_hotel",6,,,,,,
,"6bff896211ced53c56b5693cec93b085","tx_irretutorial_1ncsv_offer",11,"prices",,,,0,1,"tx_irretutorial_1ncsv_price",19,,,,,,
,"ecba35a75355bd60295dcbc3aa90c30b","tx_irretutorial_1ncsv_hotel",7,"offers",,,,0,1,"tx_irretutorial_1ncsv_offer",11,,,,,,
......@@ -59,5 +59,3 @@
,"b3963a4f186e2a6a9f99f8bc56032e5b","tx_irretutorial_1ncsv_offer",6,"prices",,,,1,0,"tx_irretutorial_1ncsv_price",11,,,,,,
,"fe803b6ecad9e2f344d769915bef71b6","tx_irretutorial_1ncsv_offer",7,"prices",,,,0,0,"tx_irretutorial_1ncsv_price",12,,,,,,
,"4f04e32221eb9407dca98a1b356e3b25","tx_irretutorial_1ncsv_offer",8,"prices",,,,0,0,"tx_irretutorial_1ncsv_price",13,,,,,,
,"6bff896211ced53c56b5693cec93b085","tx_irretutorial_1ncsv_offer",11,"prices",,,,0,1,"tx_irretutorial_1ncsv_price",19,,,,,,
,"ecba35a75355bd60295dcbc3aa90c30b","tx_irretutorial_1ncsv_hotel",7,"offers",,,,0,1,"tx_irretutorial_1ncsv_offer",11,,,,,,
......@@ -45,7 +45,6 @@
"sys_refindex",,,,,,,,,,,,,,,,,
,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
,"054faee34565a031b01d0403ffab9129","pages",91,"tx_irretutorial_hotels",,,,0,1,"tx_irretutorial_1nff_hotel",6,,,,,,
,"0be6b4051958ba5e752ac09f1b88ac7a","tx_irretutorial_1nff_offer",5,"prices",,,,2,0,"tx_irretutorial_1nff_price",9,,,,,,
,"0db25b4f2fa1f8ab4d3296280222e2b5","tx_irretutorial_1nff_hotel",5,"offers",,,,0,0,"tx_irretutorial_1nff_offer",8,,,,,,
,"0fc0d09ae681642e4bc17ef8e338b20e","tx_irretutorial_1nff_offer",5,"prices",,,,0,0,"tx_irretutorial_1nff_price",7,,,,,,
......
......@@ -54,15 +54,12 @@
,"1ea8fb364449dd57ef33bf410d0d97ce","tt_content",298,"tx_irretutorial_1nff_hotels",,,,0,0,"tx_irretutorial_1nff_hotel",5,,,,,,
,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
,"2abe914437799afd8d74ff900e1ad9ea","tx_irretutorial_1nff_offer",8,"prices",,,,0,0,"tx_irretutorial_1nff_price",13,,,,,,
,"363e6e9c12f3293d38f01286992f7cec","tx_irretutorial_1nff_hotel",6,"offers",,,,0,1,"tx_irretutorial_1nff_offer",9,,,,,,
,"3cd13aad565798bc7837b17d09eae98a","tx_irretutorial_1nff_offer",7,"prices",,,,0,0,"tx_irretutorial_1nff_price",12,,,,,,
,"447af67bf50f6b2e12eeb8928b53849b","tx_irretutorial_1nff_offer",6,"prices",,,,0,0,"tx_irretutorial_1nff_price",10,,,,,,
,"4db47dff0b7cfc1011b50654d6ae26ba","tt_content",297,"tx_irretutorial_1nff_hotels",,,,1,0,"tx_irretutorial_1nff_hotel",4,,,,,,
,"58521c3fb6b7050e33ae71d02a7ac20d","pages",89,"tx_irretutorial_hotels",,,,0,0,"tx_irretutorial_1nff_hotel",2,,,,,,
,"6341e914a1bc771531b04a589f1e6c10","tx_irretutorial_1nff_hotel",3,"offers",,,,0,0,"tx_irretutorial_1nff_offer",5,,,,,,
,"74f844144854e2f894e8a22e620948d5","tt_content",297,"tx_irretutorial_1nff_hotels",,,,0,0,"tx_irretutorial_1nff_hotel",3,,,,,,
,"8241802c77fe733045d90f9645f71e90","tx_irretutorial_1nff_offer",9,"prices",,,,0,1,"tx_irretutorial_1nff_price",14,,,,,,
,"b509b296e32d7a2ee0b525f3cb04b30c","tx_irretutorial_1nff_offer",6,"prices",,,,1,0,"tx_irretutorial_1nff_price",11,,,,,,
,"b6b18aded51cc224658c8eda1e009117","tx_irretutorial_1nff_hotel",3,"offers",,,,1,0,"tx_irretutorial_1nff_offer",6,,,,,,
,"cecaae578e249856c5651f542af6c872","tt_content",299,"tx_irretutorial_1nff_hotels",,,,0,1,"tx_irretutorial_1nff_hotel",6,,,,,,
,"ef81102fb56d455adf439a444ec05777","tx_irretutorial_1nff_offer",5,"prices",,,,1,0,"tx_irretutorial_1nff_price",8,,,,,,
......@@ -63,7 +63,6 @@
,"1ea8fb364449dd57ef33bf410d0d97ce","tt_content",298,"tx_irretutorial_1nff_hotels",,,,0,0,"tx_irretutorial_1nff_hotel",5,,,,,,
,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
,"2abe914437799afd8d74ff900e1ad9ea","tx_irretutorial_1nff_offer",8,"prices",,,,0,0,"tx_irretutorial_1nff_price",13,,,,,,
,"2b3ec50aa698b6d70ace8e3772263387","tx_irretutorial_1nff_hotel",7,"offers",,,,0,1,"tx_irretutorial_1nff_offer",11,,,,,,
,"363e6e9c12f3293d38f01286992f7cec","tx_irretutorial_1nff_hotel",6,"offers",,,,0,1,"tx_irretutorial_1nff_offer",9,,,,,,
,"3cd13aad565798bc7837b17d09eae98a","tx_irretutorial_1nff_offer",7,"prices",,,,0,0,"tx_irretutorial_1nff_price",12,,,,,,
,"447af67bf50f6b2e12eeb8928b53849b","tx_irretutorial_1nff_offer",6,"prices",,,,0,0,"tx_irretutorial_1nff_price",10,,,,,,
......@@ -75,7 +74,6 @@
,"74f844144854e2f894e8a22e620948d5","tt_content",297,"tx_irretutorial_1nff_hotels",,,,0,0,"tx_irretutorial_1nff_hotel",3,,,,,,
,"799d002fd079ca160e6db0d6d3c2273f","tx_irretutorial_1nff_offer",10,"prices",,,,1,1,"tx_irretutorial_1nff_price",18,,,,,,
,"8241802c77fe733045d90f9645f71e90","tx_irretutorial_1nff_offer",9,"prices",,,,0,1,"tx_irretutorial_1nff_price",14,,,,,,
,"afcae32edf12d45a8357ca90cbb92548","tx_irretutorial_1nff_offer",11,"prices",,,,0,1,"tx_irretutorial_1nff_price",19,,,,,,
,"b509b296e32d7a2ee0b525f3cb04b30c","tx_irretutorial_1nff_offer",6,"prices",,,,1,0,"tx_irretutorial_1nff_price",11,,,,,,
,"b6b18aded51cc224658c8eda1e009117","tx_irretutorial_1nff_hotel",3,"offers",,,,1,0,"tx_irretutorial_1nff_offer",6,,,,,,
,"cecaae578e249856c5651f542af6c872","tt_content",299,"tx_irretutorial_1nff_hotels",,,,0,1,"tx_irretutorial_1nff_hotel",6,,,,,,
......
......@@ -41,5 +41,4 @@
,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
,"cbf63549963077818db9099164f2798d","sys_category",32,"items",,,,0,1,"tt_content",297,,,,,,
,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
......@@ -35,7 +35,6 @@
,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
,"1130084e4038e95f2d5806b731cd416a","tt_content",300,"l18n_parent",,,,0,0,"tt_content",299,,,,,,
,"1aabb1deaec63ac369ca0b48bb8ed261","tt_content",321,"l18n_parent",,,,0,1,"tt_content",299,,,,,,
,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
,"25f3b71b67f29fa33fbfd4fa2d930b70","tt_content",302,"l18n_parent",,,,0,0,"tt_content",297,,,,,,
,"4433e80cbec985130824d6d302ad293f","pages",91,"sys_language_uid",,,,0,1,"sys_language",1,,,,,,
......
......@@ -38,6 +38,4 @@
,"25f3b71b67f29fa33fbfd4fa2d930b70","tt_content",302,"l18n_parent",,,,0,0,"tt_content",297,,,,,,
,"4a1e04a83a4a17882682d86f6cd61f3d","tt_content",301,"l18n_parent",,,,0,0,"tt_content",297,,,,,,
,"583b9974d1df1d9efb695cdabfe53a73","pages",91,"l10n_parent",,,,0,0,"pages",89,,,,,,
,"81bed3ff81afcdb0e38d7f99f497b890","pages",92,"l10n_parent",,,,0,1,"pages",89,,,,,,
,"8d96507cabb44e003ba3015a13265f03","pages",91,"sys_language_uid",,,,0,0,"sys_language",1,,,,,,
,"9d3332684525c081c5fd3ce639d0df64","pages",92,"sys_language_uid",,,,0,1,"sys_language",1,,,,,,
......@@ -35,7 +35,6 @@
,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
,"1130084e4038e95f2d5806b731cd416a","tt_content",300,"l18n_parent",,,,0,0,"tt_content",299,,,,,,
,"1aabb1deaec63ac369ca0b48bb8ed261","tt_content",321,"l18n_parent",,,,0,1,"tt_content",299,,,,,,
,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
,"25f3b71b67f29fa33fbfd4fa2d930b70","tt_content",302,"l18n_parent",,,,0,0,"tt_content",297,,,,,,
,"4433e80cbec985130824d6d302ad293f","pages",91,"sys_language_uid",,,,0,1,"sys_language",1,,,,,,
......
......@@ -39,6 +39,4 @@
,"25f3b71b67f29fa33fbfd4fa2d930b70","tt_content",302,"l18n_parent",,,,0,0,"tt_content",297,,,,,,
,"4a1e04a83a4a17882682d86f6cd61f3d","tt_content",301,"l18n_parent",,,,0,0,"tt_content",297,,,,,,
,"583b9974d1df1d9efb695cdabfe53a73","pages",91,"l10n_parent",,,,0,0,"pages",89,,,,,,
,"81bed3ff81afcdb0e38d7f99f497b890","pages",92,"l10n_parent",,,,0,1,"pages",89,,,,,,
,"8d96507cabb44e003ba3015a13265f03","pages",91,"sys_language_uid",,,,0,0,"sys_language",1,,,,,,
,"9d3332684525c081c5fd3ce639d0df64","pages",92,"sys_language_uid",,,,0,1,"sys_language",1,,,,,,
......@@ -38,6 +38,4 @@
,"25f3b71b67f29fa33fbfd4fa2d930b70","tt_content",302,"l18n_parent",,,,0,0,"tt_content",297,,,,,,
,"4a1e04a83a4a17882682d86f6cd61f3d","tt_content",301,"l18n_parent",,,,0,0,"tt_content",297,,,,,,
,"583b9974d1df1d9efb695cdabfe53a73","pages",91,"l10n_parent",,,,0,0,"pages",89,,,,,,
,"81bed3ff81afcdb0e38d7f99f497b890","pages",92,"l10n_parent",,,,0,1,"pages",89,,,,,,
,"8d96507cabb44e003ba3015a13265f03","pages",91,"sys_language_uid",,,,0,0,"sys_language",1,,,,,,
,"9d3332684525c081c5fd3ce639d0df64","pages",92,"sys_language_uid",,,,0,1,"sys_language",1,,,,,,
......@@ -22,8 +22,6 @@
,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string"
,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,
,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,
,"98a793c05985daac9bfc537e0d8fc08b","tt_content",299,"tx_testdatahandler_select",,,,0,1,"tx_testdatahandler_element",2,
,"9e50e2d84c69c9f744701bb17b81abfd","tt_content",299,"tx_testdatahandler_select",,,,1,1,"tx_testdatahandler_element",3,
,"d333521843e8774369e112581bd4643b","tt_content",297,"tx_testdatahandler_select",,,,1,0,"tx_testdatahandler_element",2,
,"d7065184b2d510f3fada875169bc8c57","tt_content",297,"tx_testdatahandler_select",,,,0,0,"tx_testdatahandler_element",1,
,"f54bf3a4ddc51685c0586b31015312cb","tt_content",298,"tx_testdatahandler_select",,,,1,0,"tx_testdatahandler_element",3,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment