Skip to content
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

Request possibly null in EXT:container Upgrade Wizard #988

Open
80Quattro opened this issue Mar 6, 2024 · 1 comment
Open

Request possibly null in EXT:container Upgrade Wizard #988

80Quattro opened this issue Mar 6, 2024 · 1 comment

Comments

@80Quattro
Copy link

Occurs if there is also installed the extension b13/container

After update to v12 (typo3 & powermail) the all Upgrade Wizards need to be executed.

While executing Wizard EXT:container: Migrate "container" sorting, I see
image

This error is repeated in many installations where both extensions are installed.

@80Quattro
Copy link
Author

I suggest a quick patch as a temporary solution

Index: Classes/EventListener/FlexFormParsingModifyEventListener.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/Classes/EventListener/FlexFormParsingModifyEventListener.php b/Classes/EventListener/FlexFormParsingModifyEventListener.php
--- a/Classes/EventListener/FlexFormParsingModifyEventListener.php
+++ b/Classes/EventListener/FlexFormParsingModifyEventListener.php	(date 1709025191229)
@@ -77,13 +77,16 @@

     private function getPidForCurrentRecord(): int
     {
+        $uid = 0;
         $request = $this->getRequest();
-        $queryParams = $request->getQueryParams();
-        $uid = array_keys($queryParams['edit']['tt_content'] ?? [])[0] ?? 0;
+        if($request) {
+            $queryParams = $request->getQueryParams();
+            $uid = array_keys($queryParams['edit']['tt_content'] ?? [])[0] ?? 0;
+        }
         return DatabaseUtility::getPidForRecord($uid, 'tt_content');
     }

-    private function getRequest(): ServerRequestInterface
+    private function getRequest(): ?ServerRequestInterface
     {
         return $GLOBALS['TYPO3_REQUEST'];
     }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant