Commit 9f3b9eca authored by Oliver Klee's avatar Oliver Klee Committed by Stefan Bürk
Browse files

[TASK] Simplify a condition in the workspaces DataHandlerHook

a || (b && !a)

can be simplified to

a || b

(because the second sub-condition is only evaluated if a is false).

Resolves: #97421
Releases: main, 11.5
Change-Id: I04d62fd46736bb4a0b9dfce54851aaa8f99d20e1
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74345

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Jonas Eberle's avatarJonas Eberle <flightvision@googlemail.com>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Jonas Eberle's avatarJonas Eberle <flightvision@googlemail.com>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
parent 252173d3
......@@ -4795,11 +4795,6 @@ parameters:
count: 1
path: ../../typo3/sysext/workspaces/Classes/Domain/Record/WorkspaceRecord.php
-
message: "#^Negated boolean expression is always true\\.$#"
count: 1
path: ../../typo3/sysext/workspaces/Classes/Hook/DataHandlerHook.php
-
message: "#^Offset 0 does not exist on non\\-empty\\-array\\<string, mixed\\>\\.$#"
count: 2
......
......@@ -373,7 +373,7 @@ class DataHandlerHook
// Workspace destination check:
// All records can be inserted if $recordMustNotBeVersionized is true.
// Only new versions can be inserted if $recordMustNotBeVersionized is FALSE.
if (!($recordMustNotBeVersionized || $canMoveRecord && !$recordMustNotBeVersionized)) {
if (!($recordMustNotBeVersionized || $canMoveRecord)) {
$workspaceAccessBlocked['dest1'] = 'Could not insert record from table "' . $table . '" in destination PID "' . $resolvedPid . '" ';
}
......
Supports Markdown
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