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

Illegal offset type in isset or empty since statamic v5 upgrade #21

Closed
atomicjam opened this issue May 14, 2024 · 5 comments
Closed

Illegal offset type in isset or empty since statamic v5 upgrade #21

atomicjam opened this issue May 14, 2024 · 5 comments

Comments

@atomicjam
Copy link

Bug description

been using sitemap for a while fine with statamic v4 just upgraded to v5 and sitemap throws.

other statamic plugins are working and statamic v5 working fine otherwise.

Illegal offset type in isset or empty thrown on visiting /sitemap.xml

Steps to reproduce

upgrade to v5 statamic and visit /sitemap.xml

Environment and versions

Environment
Application Name: Laravel
Laravel Version: 10.48.10
PHP Version: 8.3.7
Composer Version: 2.7.6
Environment: local
Debug Mode: ENABLED
URL: localhost
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: NOT CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 3
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.0.2 PRO

Statamic Addons
mitydigital/feedamic: 2.3.2
mitydigital/sitemapamic: 3.0.1
rias/statamic-redirect: 3.7.1

Additional details

php please sitemapamic:clear. and clearing other caches does not help logs attached:

[2024-05-14 08:57:22] local.ERROR: Illegal offset type in isset or empty {"exception":"[object] (TypeError(code: 0): Illegal offset type in isset or empty at /var/www/html/vendor/statamic/cms/src/Facades/Endpoint/URL.php:226)
[stacktrace]
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(355): Statamic\Facades\Endpoint\URL->isExternal()
#1 /var/www/html/vendor/mitydigital/sitemapamic/src/Support/Sitemapamic.php(172): Illuminate\Support\Facades\Facade::__callStatic()
#2 [internal function]: MityDigital\Sitemapamic\Support\Sitemapamic->MityDigital\Sitemapamic\Support\{closure}()
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(911): array_filter()
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(387): Illuminate\Support\Arr::where()
#5 /var/www/html/vendor/mitydigital/sitemapamic/src/Support/Sitemapamic.php(158): Illuminate\Support\Collection->filter()
#6 /var/www/html/vendor/mitydigital/sitemapamic/src/Http/Controllers/SitemapamicController.php(41): MityDigital\Sitemapamic\Support\Sitemapamic->MityDigital\Sitemapamic\Support\{closure}()
#7 [internal function]: MityDigital\Sitemapamic\Http\Controllers\SitemapamicController->MityDigital\Sitemapamic\Http\Controllers\{closure}()
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(600): array_map()
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(777): Illuminate\Support\Arr::map()
#10 /var/www/html/vendor/mitydigital/sitemapamic/src/Http/Controllers/SitemapamicController.php(41): Illuminate\Support\Collection->map()
#11 /var/www/html/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(437): MityDigital\Sitemapamic\Http\Controllers\SitemapamicController->MityDigital\Sitemapamic\Http\Controllers\{closure}()
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(429): Illuminate\Cache\Repository->rememberForever()
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(355): Illuminate\Cache\CacheManager->__call()
#14 /var/www/html/vendor/mitydigital/sitemapamic/src/Http/Controllers/SitemapamicController.php(73): Illuminate\Support\Facades\Facade::__callStatic()
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): MityDigital\Sitemapamic\Http\Controllers\SitemapamicController->show()
#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\Routing\Controller->callAction()
#17 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(259): Illuminate\Routing\ControllerDispatcher->dispatch()
#18 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\Routing\Route->runController()
#19 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(806): Illuminate\Routing\Route->run()
#20 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#21 /var/www/html/vendor/spatie/laravel-csp/src/AddCspHeaders.php(13): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#22 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Spatie\Csp\AddCspHeaders->handle()
#23 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#24 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Routing\Middleware\SubstituteBindings->handle()
#25 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#26 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle()
#27 /var/www/html/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#28 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\View\Middleware\ShareErrorsFromSession->handle()
#29 /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#30 /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\Session\Middleware\StartSession->handleStatefulRequest()
#31 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Session\Middleware\StartSession->handle()
#32 /var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#33 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle()
#34 /var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#35 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Cookie\Middleware\EncryptCookies->handle()
#36 /var/www/html/vendor/rias/statamic-redirect/src/Http/Middleware/HandleNotFound.php(24): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#37 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Rias\StatamicRedirect\Http\Middleware\HandleNotFound->handle()
#38 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#39 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(805): Illuminate\Pipeline\Pipeline->then()
#40 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(784): Illuminate\Routing\Router->runRouteWithinStack()
#41 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(748): Illuminate\Routing\Router->runRoute()
#42 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(737): Illuminate\Routing\Router->dispatchToRoute()
#43 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(200): Illuminate\Routing\Router->dispatch()
#44 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}()
#45 /var/www/html/vendor/statamic/cms/src/Http/Middleware/StopImpersonating.php(12): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#46 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\Http\Middleware\StopImpersonating->handle()
#47 /var/www/html/vendor/statamic/cms/src/Http/Middleware/DisableFloc.php(17): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#48 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\Http\Middleware\DisableFloc->handle()
#49 /var/www/html/vendor/statamic/cms/src/Http/Middleware/CheckMultisite.php(15): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#50 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\Http\Middleware\CheckMultisite->handle()
#51 /var/www/html/vendor/statamic/cms/src/Http/Middleware/CheckComposerJsonScripts.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#52 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\Http\Middleware\CheckComposerJsonScripts->handle()
#53 /var/www/html/vendor/statamic/cms/src/Http/Middleware/PoweredByHeader.php(18): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#54 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\Http\Middleware\PoweredByHeader->handle()
#55 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#56 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#57 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle()
#58 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#59 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#60 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Foundation\Http\Middleware\TrimStrings->handle()
#61 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#62 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle()
#63 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(99): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#64 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
#65 /var/www/html/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#66 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Http\Middleware\HandleCors->handle()
#67 /var/www/html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#68 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Http\Middleware\TrustProxies->handle()
#69 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#70 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\Pipeline\Pipeline->then()
#71 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#72 /var/www/html/public/index.php(51): Illuminate\Foundation\Http\Kernel->handle()
#73 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/resources/server.php(16): require_once('...')
#74 {main}
"}

@martyf
Copy link
Contributor

martyf commented May 14, 2024

I wonder if this is related to your Feedamic issue too - a repo of the issue would be great to see what is going on, as I cannot replicate this.

@atomicjam
Copy link
Author

sure thanks for help,

https://github.com/atomicjam/flourish-debug

details of setup are in readme if you need them, also there is a branch called main which is statamic 5 showing error, and a branch called v4 which is working fine.

@martyf
Copy link
Contributor

martyf commented May 15, 2024

Thanks for the repo - made it much easier to play with and fix.

Both Feedamic and Sitemapamic are fixed up - composer update will install the latest point releases and should take care of these.

@martyf martyf closed this as completed May 15, 2024
@atomicjam
Copy link
Author

all working again thanks for your help

@martyf
Copy link
Contributor

martyf commented May 16, 2024

No worries at all 🙃

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