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

Entry CP view producing errors: RelationshipFieldtypeController #7014

Closed
stuartcusackie opened this issue Nov 7, 2022 · 2 comments
Closed

Comments

@stuartcusackie
Copy link

stuartcusackie commented Nov 7, 2022

Bug description

Just noticed my laravel.log file is full of these errors on my local environment - See logs section. I have cleared caches and staches but it keeps coming back. The userId listed below does still exist.

Let me know if I can provide any other useful info.

How to reproduce

No idea. Only happens when viewing certain entries.

Logs

[2022-11-07 12:03:31] local.ERROR: Trying to access array offset on value of type null {"userId":"faff89d4-1651-4928-a7b3-730cf83e414c","exception":"[object] (ErrorException(code: 0): Trying to access array offset on value of type null at C:\\webdev\\projectx\\vendor\\statamic\\cms\\src\\Http\\Controllers\\CP\\Fieldtypes\\RelationshipFieldtypeController.php:47)
[stacktrace]
#0 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Bootstrap\\HandleExceptions.php(259): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(2, 'Trying to acces...', 'C:\\\\webdev\\\\larag...', 47)
#1 C:\\webdev\\projectx\\vendor\\statamic\\cms\\src\\Http\\Controllers\\CP\\Fieldtypes\\RelationshipFieldtypeController.php(47): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}(2, 'Trying to acces...', 'C:\\\\webdev\\\\larag...', 47)
#2 C:\\webdev\\projectx\\vendor\\statamic\\cms\\src\\Http\\Controllers\\CP\\Fieldtypes\\RelationshipFieldtypeController.php(16): Statamic\\Http\\Controllers\\CP\\Fieldtypes\\RelationshipFieldtypeController->fieldtype(Object(Statamic\\Http\\Requests\\FilteredRequest))
#3 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Controller.php(54): Statamic\\Http\\Controllers\\CP\\Fieldtypes\\RelationshipFieldtypeController->index(Object(Statamic\\Http\\Requests\\FilteredRequest))
#4 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction('index', Array)
#5 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php(260): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(Statamic\\Http\\Controllers\\CP\\Fieldtypes\\RelationshipFieldtypeController), 'index')
#6 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php(205): Illuminate\\Routing\\Route->runController()
#7 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(725): Illuminate\\Routing\\Route->run()
#8 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#9 C:\\webdev\\projectx\\vendor\\statamic\\cms\\src\\Http\\Middleware\\DeleteTemporaryFileUploads.php(18): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#10 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Statamic\\Http\\Middleware\\DeleteTemporaryFileUploads->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#11 C:\\webdev\\projectx\\vendor\\statamic\\cms\\src\\Http\\Middleware\\CP\\CountUsers.php(18): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#12 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Statamic\\Http\\Middleware\\CP\\CountUsers->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#13 C:\\webdev\\projectx\\vendor\\statamic\\cms\\src\\Http\\Middleware\\CP\\Localize.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#14 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Statamic\\Http\\Middleware\\CP\\Localize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#15 C:\\webdev\\projectx\\vendor\\statamic\\cms\\src\\Http\\Middleware\\CP\\Authorize.php(25): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#16 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Statamic\\Http\\Middleware\\CP\\Authorize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#17 C:\\webdev\\projectx\\vendor\\statamic\\cms\\src\\Http\\Middleware\\CP\\AddToasts.php(22): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#18 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Statamic\\Http\\Middleware\\CP\\AddToasts->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#19 C:\\webdev\\projectx\\vendor\\statamic\\cms\\src\\Http\\Middleware\\CP\\AuthGuard.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#20 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Statamic\\Http\\Middleware\\CP\\AuthGuard->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#21 C:\\webdev\\projectx\\vendor\\statamic\\cms\\src\\Http\\Middleware\\CP\\ContactOutpost.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#22 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Statamic\\Http\\Middleware\\CP\\ContactOutpost->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#23 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#24 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#25 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#26 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#27 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\View\\Middleware\\ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#28 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#29 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Session\\Middleware\\StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#30 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Session\\Middleware\\StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest(Object(Illuminate\\Http\\Request), Object(Illuminate\\Session\\Store), Object(Closure))
#31 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#32 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#33 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#34 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Cookie\\Middleware\\EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#35 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#36 C:\\webdev\\projectx\\vendor\\statamic\\cms\\src\\Http\\Middleware\\SwapExceptionHandler.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#37 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Statamic\\Http\\Middleware\\SwapExceptionHandler->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#38 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#39 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(726): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#40 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(703): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#41 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(667): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#42 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(656): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#43 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php(190): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#44 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#45 C:\\webdev\\projectx\\vendor\\statamic\\cms\\src\\Http\\Middleware\\DisableFloc.php(18): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#46 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Statamic\\Http\\Middleware\\DisableFloc->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#47 C:\\webdev\\projectx\\vendor\\statamic\\cms\\src\\Http\\Middleware\\CheckMultisite.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#48 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Statamic\\Http\\Middleware\\CheckMultisite->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#49 C:\\webdev\\projectx\\vendor\\statamic\\cms\\src\\Http\\Middleware\\CheckComposerJsonScripts.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#50 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Statamic\\Http\\Middleware\\CheckComposerJsonScripts->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#51 C:\\webdev\\projectx\\vendor\\statamic\\cms\\src\\Http\\Middleware\\PoweredByHeader.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#52 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Statamic\\Http\\Middleware\\PoweredByHeader->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#53 C:\\webdev\\projectx\\vendor\\lukeraymonddowning\\honey\\src\\Http\\Middleware\\BlockSpammers.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#54 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Lukeraymonddowning\\Honey\\Http\\Middleware\\BlockSpammers->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#55 C:\\webdev\\projectx\\vendor\\livewire\\livewire\\src\\DisableBrowserCache.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#56 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Livewire\\DisableBrowserCache->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#57 C:\\webdev\\projectx\\vendor\\barryvdh\\laravel-debugbar\\src\\Middleware\\InjectDebugbar.php(59): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#58 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#59 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#60 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#61 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#62 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#63 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#64 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#65 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#66 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#67 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#68 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#69 C:\\webdev\\projectx\\vendor\\fruitcake\\laravel-cors\\src\\HandleCors.php(38): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#70 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Fruitcake\\Cors\\HandleCors->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#71 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Http\\Middleware\\TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#72 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#73 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#74 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php(165): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#75 C:\\webdev\\projectx\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php(134): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#76 C:\\webdev\\projectx\\public\\index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#77 {main}
"}

Environment

Version: 3.3.52 PRO
Laravel Version: 9.38.0
PHP Version: 8.1.1

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

No response

Additional details

No response

@joshuablum
Copy link
Member

joshuablum commented Nov 7, 2022

Hm, could be related to #6823? 🤔

Note that it won't work using PHP 8.1.0
It's fixed in 8.1.2, at least.

You're running 8.1.1. Could you please update your PHP version and see whether this solves the issue?

@stuartcusackie
Copy link
Author

That fixes it alright. Latest version of PHP and no errors showing.

Thanks!!

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

2 participants