-
-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUGFIX] Handle deleted workspace records #3427
base: main
Are you sure you want to change the base?
Conversation
I may not fully understand in which cases this function is used, but I think that deleted records should be checked as well. Since this only happens when records are deleted it probably does not add any unwanted behaviour - except possibly a call to Solr to delete a record that is not indexed - but checking the deleted record anyway is cleaner in my opinion. |
Can someone please restart the tests? It's not possible to see whats wrong with this patch. |
@froemken |
Classes/Util.php
Outdated
@@ -114,7 +114,7 @@ public static function isDraftRecord(string $table, int $uid): bool | |||
$isWorkspaceRecord = false; | |||
|
|||
if ((ExtensionManagementUtility::isLoaded('workspaces')) && (BackendUtility::isTableWorkspaceEnabled($table))) { | |||
$record = BackendUtility::getRecord($table, $uid, 'pid, t3ver_state'); | |||
$record = BackendUtility::getRecord($table, $uid, 'pid, t3ver_state', '', false); | |||
|
|||
if ($record['pid'] == '-1' || $record['t3ver_state'] > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Officially getRecord() can return either array or null. This patch works, but I would prefer to check for array first, before accessing the array keys.
Sorry, I lost track of this PR. The new version of the main branch already includes a This could be merged then? |
363e234
to
a9bae2f
Compare
e865edc
to
89d9f0d
Compare
16bf8c5
to
dfcdd98
Compare
What this pr does
This pull request handles deleted records when checking if the changed record is part of a workspace.
How to test
Delete a record with workspaces enabled.
Fixes: #3413