Open dontWatchMeCode opened 3 months ago
@dontWatchMeCode maybe I missed something so therefore: Why did you add a @
before the $this
?
Ignores the warning thrown if the array key is not set:
https://www.php.net/manual/en/language.operators.errorcontrol.php (Error Control Operators)
Since the value is set to PID 1 and the warning isn't needed.
Interesting. Thanks for the input. It's not me to decide whether to go this way but: I cannot reproduce this error at all.
Wait... I really need to setup a extra TYPO3 for the EXT:cart stuff...
I can imagine that @extcode prefers something like
$pageId = isset($this->request->getQueryParams()['id']) ? (int)$this->request->getQueryParams()['id'] : 1;
to not block warning that we are not expecting at the moment.
Thanks,
i'm using PHP 8.1 with t3 v12 and error reporting in dev mode.
Maybe an older PHP Version or t3 set to ignore warnings?
isset(...
should still throw an error.
array_key_exists('id', $this->request->getQueryParams()) ...
should work as an alternative to @
.
Yes, I meant with "wait..." that I had a wrong configuration. Now I can reproduce the error. But it's solved with the code snippet that I wrote above.
reproduce:
Best regards.