news icon indicating copy to clipboard operation
news copied to clipboard

access array offset in Workspaces

Open chriskrj opened this issue 2 years ago • 0 comments

Bug Report

Current Behavior When my Backend User is logged in and not in Live Workspace, Frontend breaks with this Error Message:

PHP Warning: Trying to access array offset on value of type null in /vendor/georgringer/news/Classes/ViewHelpers/LinkViewHelper.php line 257

Expected behavior/output Show current Staging Workspace in Frontend

Environment

  • TYPO3 version(s): [11.5.16]
  • news version: [10.0.1]
  • php: [8.1.1]
  • Is your TYPO3 installation set up with Composer (Composer Mode): [yes]
  • OS: [e.g. OSX 12.6]

Possible Solution When i add isset in line 257 around $record[$uid] everything works fine again.

if (isset($record['uid'])) {
  $uid = $record['uid'];
}

Additional context Same behavior in news Version 9.4 I didn't check all View Helpers in TYPO3 11 / php 8.1 with Workspaces yet. But at the moment I do not have any other Errors with news and Workspaces.

chriskrj avatar Oct 07 '22 15:10 chriskrj