statamic / eloquent-driver

Provides support for storing your Statamic data in a database, rather than flat files.
https://statamic.dev/tips/storing-content-in-a-database
MIT License
108 stars 77 forks source link

After Taxonomies and terms switch to eloquent driver error occurs #354

Closed de-raaf-media closed 1 month ago

de-raaf-media commented 1 month ago

Bug description

Illegal offset type in isset or empty. Seems somewhere an object is passed to OffsetExists in Collection?

How to reproduce

Switch tot eloquent driver for taxonomies and terms. The antlers code then leads to the error "Illegal offset type in isset or empty"

{{ categories }}
{{ entries as="category_entries" }}
{{ if category_entries | count > 0 }}
<div class="column is-3">
    <!-- my product -->
    <p>Number of items: {{ category_entries | count }}</p>
</div>
{{ /if }}
{{ /entries }}
{{ /categories }}

Logs

No response

Environment

Environment
Application Name: x
Laravel Version: 11.20.0
PHP Version: 8.2.20
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: x.test
Maintenance Mode: OFF
Timezone: UTC
Locale: nl

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

Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: daily
Mail: smtp
Queue: database
Session: file

Statamic
Addons: 5
Sites: 1
Stache Watcher: Disabled
Static Caching: Disabled
Version: 5.25.0 PRO

Statamic Addons

Statamic Eloquent Driver
Asset Containers: file
Assets: file
Blueprints: file
Collection Trees: file
Collections: file
Entries: eloquent
Forms: file
Global Sets: file
Global Variables: file
Navigation Trees: file
Navigations: file
Revisions: file
Sites: file
Taxonomies: eloquent
Terms: eloquent
Tokens: file

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

duncanmcclean commented 1 month ago

The antlers code then leads to the error "Illegal offset type in isset or empty"

Are you able to share the full stack trace for this error?

de-raaf-media commented 1 month ago

Hi @duncanmcclean, here you go:

[2024-09-24 13:49:36] local.ERROR: Illegal offset type in isset or empty {"view":{"view":"","data":[]},"exception":"[object] (Spatie\\LaravelIgnition\\Exceptions\\ViewException(code: 0): Illegal offset type in isset or empty at /Users/x/Sites/x/resources/views/categorieen/index.antlers.html:11)
[stacktrace]
#0 /Users/x/Sites/x/resources/views/categorieen/index.antlers.html(11): ()
#1 /Users/x/Sites/x/vendor/statamic/cms/src/Taxonomies/Term.php(281): Illuminate\\Support\\Collection->offsetExists(Object(Statamic\\Sites\\Site))
#2 /Users/x/Sites/x/vendor/statamic/cms/src/Taxonomies/LocalizedTerm.php(77): Statamic\\Taxonomies\\Term->dataForLocale(Object(Statamic\\Sites\\Site))
#3 /Users/x/Sites/x/vendor/statamic/cms/src/Taxonomies/LocalizedTerm.php(96): Statamic\\Taxonomies\\LocalizedTerm->data()
#4 /Users/x/Sites/x/vendor/statamic/cms/src/Taxonomies/AugmentedTerm.php(19): Statamic\\Taxonomies\\LocalizedTerm->values()
#5 /Users/x/Sites/x/vendor/statamic/cms/src/Data/AbstractAugmented.php(37): Statamic\\Taxonomies\\AugmentedTerm->keys()
#6 /Users/x/Sites/x/vendor/statamic/cms/src/Data/HasAugmentedInstance.php(25): Statamic\\Data\\AbstractAugmented->select(NULL)
#7 /Users/x/Sites/x/vendor/statamic/cms/src/Data/HasAugmentedInstance.php(40): Statamic\\Taxonomies\\LocalizedTerm->toAugmentedCollectionWithFields(NULL)
#8 /Users/x/Sites/x/vendor/statamic/cms/src/View/Antlers/Language/Runtime/Sandbox/RuntimeValues.php(33): Statamic\\Taxonomies\\LocalizedTerm->toDeferredAugmentedArray()
#9 /Users/x/Sites/x/vendor/statamic/cms/src/View/Antlers/Language/Runtime/NodeProcessor.php(2532): Statamic\\View\\Antlers\\Language\\Runtime\\Sandbox\\RuntimeValues::resolveWithRuntimeIsolation(Object(Statamic\\Taxonomies\\LocalizedTerm))
#10 /Users/x/Sites/x/vendor/statamic/cms/src/View/Antlers/Language/Runtime/NodeProcessor.php(2305): Statamic\\View\\Antlers\\Language\\Runtime\\NodeProcessor->addLoopIterationVariables(Array)
#11 /Users/x/Sites/x/vendor/statamic/cms/src/View/Antlers/Language/Runtime/NodeProcessor.php(750): Statamic\\View\\Antlers\\Language\\Runtime\\NodeProcessor->reduce(Array)
#12 /Users/x/Sites/x/vendor/statamic/cms/src/View/Antlers/Language/Runtime/RuntimeParser.php(381): Statamic\\View\\Antlers\\Language\\Runtime\\NodeProcessor->render(Array)
#13 /Users/x/Sites/x/vendor/statamic/cms/src/View/Antlers/Language/Runtime/RuntimeParser.php(773): Statamic\\View\\Antlers\\Language\\Runtime\\RuntimeParser->renderText('{{#\\n@name Categ...', Array)
#14 /Users/x/Sites/x/vendor/statamic/cms/src/View/Antlers/Engine.php(93): Statamic\\View\\Antlers\\Language\\Runtime\\RuntimeParser->parseView('/Users/x...', '{{#\\n@name Categ...', Array)
#15 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/View/View.php(208): Statamic\\View\\Antlers\\Engine->get('/Users/x...', Array)
#16 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/View/View.php(191): Illuminate\\View\\View->getContents()
#17 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/View/View.php(160): Illuminate\\View\\View->renderContents()
#18 /Users/x/Sites/x/vendor/statamic/cms/src/View/View.php(104): Illuminate\\View\\View->render()
#19 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Responses/DataResponse.php(146): Statamic\\View\\View->render()
#20 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Responses/DataResponse.php(42): Statamic\\Http\\Responses\\DataResponse->contents()
#21 /Users/x/Sites/x/vendor/statamic/cms/src/Taxonomies/Taxonomy.php(389): Statamic\\Http\\Responses\\DataResponse->toResponse(Object(Illuminate\\Http\\Request))
#22 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Routing/Router.php(902): Statamic\\Taxonomies\\Taxonomy->toResponse(Object(Illuminate\\Http\\Request))
#23 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Routing/Router.php(887): Illuminate\\Routing\\Router::toResponse(Object(Illuminate\\Http\\Request), Object(Statamic\\Eloquent\\Taxonomies\\Taxonomy))
#24 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Routing/Router.php(807): Illuminate\\Routing\\Router->prepareResponse(Object(Illuminate\\Http\\Request), Object(Statamic\\Eloquent\\Taxonomies\\Taxonomy))
#25 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#26 /Users/x/Sites/x/vendor/statamic/cms/src/StaticCaching/Middleware/Cache.php(70): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#27 /Users/x/Sites/x/vendor/statamic/cms/src/StaticCaching/Middleware/Cache.php(62): Statamic\\StaticCaching\\Middleware\\Cache->handleRequest(Object(Illuminate\\Http\\Request), Object(Closure))
#28 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Cache/Lock.php(131): Statamic\\StaticCaching\\Middleware\\Cache->Statamic\\StaticCaching\\Middleware\\{closure}()
#29 /Users/x/Sites/x/vendor/statamic/cms/src/StaticCaching/Middleware/Cache.php(62): Illuminate\\Cache\\Lock->block(30, Object(Closure))
#30 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\StaticCaching\\Middleware\\Cache->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#31 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/AuthGuard.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#32 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\AuthGuard->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#33 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/AddViewPaths.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#34 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\AddViewPaths->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#35 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/Localize.php(38): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#36 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\Localize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#37 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/HandleToken.php(13): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#38 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\HandleToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#39 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/StacheLock.php(29): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#40 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\StacheLock->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#41 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(51): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#42 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#43 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(88): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#44 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#45 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#46 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#47 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#48 /Users/x/Sites/x/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))
#49 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#50 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#51 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#52 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(75): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#53 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#54 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#55 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Routing/Router.php(807): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#56 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Routing/Router.php(786): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#57 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Routing/Router.php(750): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#58 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Routing/Router.php(739): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#59 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(201): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#60 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#61 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/StopImpersonating.php(12): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#62 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\StopImpersonating->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#63 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/DisableFloc.php(17): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#64 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\DisableFloc->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#65 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/CheckMultisite.php(15): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#66 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CheckMultisite->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#67 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/CheckComposerJsonScripts.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#68 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CheckComposerJsonScripts->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#69 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/PoweredByHeader.php(18): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#70 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\PoweredByHeader->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#71 /Users/x/Sites/x/vendor/livewire/livewire/src/Features/SupportDisablingBackButtonCache/DisableBackButtonCacheMiddleware.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#72 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Livewire\\Features\\SupportDisablingBackButtonCache\\DisableBackButtonCacheMiddleware->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#73 /Users/x/Sites/x/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(66): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#74 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#75 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#76 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#77 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#78 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#79 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(51): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#80 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#81 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#82 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#83 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(110): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#84 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#85 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#86 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\HandleCors->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#87 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#88 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#89 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#90 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#91 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#92 /Users/x/Sites/x/public/index.php(51): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#93 /Applications/Herd.app/Contents/Resources/valet/server.php(167): require('/Users/x...')
#94 {main}

[previous exception] [object] (TypeError(code: 0): Illegal offset type in isset or empty at /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Collections/Collection.php:1865)
[stacktrace]
#0 /Users/x/Sites/x/vendor/statamic/cms/src/Taxonomies/Term.php(281): Illuminate\\Support\\Collection->offsetExists(Object(Statamic\\Sites\\Site))
#1 /Users/x/Sites/x/vendor/statamic/cms/src/Taxonomies/LocalizedTerm.php(77): Statamic\\Taxonomies\\Term->dataForLocale(Object(Statamic\\Sites\\Site))
#2 /Users/x/Sites/x/vendor/statamic/cms/src/Taxonomies/LocalizedTerm.php(96): Statamic\\Taxonomies\\LocalizedTerm->data()
#3 /Users/x/Sites/x/vendor/statamic/cms/src/Taxonomies/AugmentedTerm.php(19): Statamic\\Taxonomies\\LocalizedTerm->values()
#4 /Users/x/Sites/x/vendor/statamic/cms/src/Data/AbstractAugmented.php(37): Statamic\\Taxonomies\\AugmentedTerm->keys()
#5 /Users/x/Sites/x/vendor/statamic/cms/src/Data/HasAugmentedInstance.php(25): Statamic\\Data\\AbstractAugmented->select(NULL)
#6 /Users/x/Sites/x/vendor/statamic/cms/src/Data/HasAugmentedInstance.php(40): Statamic\\Taxonomies\\LocalizedTerm->toAugmentedCollectionWithFields(NULL)
#7 /Users/x/Sites/x/vendor/statamic/cms/src/View/Antlers/Language/Runtime/Sandbox/RuntimeValues.php(33): Statamic\\Taxonomies\\LocalizedTerm->toDeferredAugmentedArray()
#8 /Users/x/Sites/x/vendor/statamic/cms/src/View/Antlers/Language/Runtime/NodeProcessor.php(2532): Statamic\\View\\Antlers\\Language\\Runtime\\Sandbox\\RuntimeValues::resolveWithRuntimeIsolation(Object(Statamic\\Taxonomies\\LocalizedTerm))
#9 /Users/x/Sites/x/vendor/statamic/cms/src/View/Antlers/Language/Runtime/NodeProcessor.php(2305): Statamic\\View\\Antlers\\Language\\Runtime\\NodeProcessor->addLoopIterationVariables(Array)
#10 /Users/x/Sites/x/vendor/statamic/cms/src/View/Antlers/Language/Runtime/NodeProcessor.php(750): Statamic\\View\\Antlers\\Language\\Runtime\\NodeProcessor->reduce(Array)
#11 /Users/x/Sites/x/vendor/statamic/cms/src/View/Antlers/Language/Runtime/RuntimeParser.php(381): Statamic\\View\\Antlers\\Language\\Runtime\\NodeProcessor->render(Array)
#12 /Users/x/Sites/x/vendor/statamic/cms/src/View/Antlers/Language/Runtime/RuntimeParser.php(773): Statamic\\View\\Antlers\\Language\\Runtime\\RuntimeParser->renderText('{{#\\n@name Categ...', Array)
#13 /Users/x/Sites/x/vendor/statamic/cms/src/View/Antlers/Engine.php(93): Statamic\\View\\Antlers\\Language\\Runtime\\RuntimeParser->parseView('/Users/x...', '{{#\\n@name Categ...', Array)
#14 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/View/View.php(208): Statamic\\View\\Antlers\\Engine->get('/Users/x...', Array)
#15 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/View/View.php(191): Illuminate\\View\\View->getContents()
#16 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/View/View.php(160): Illuminate\\View\\View->renderContents()
#17 /Users/x/Sites/x/vendor/statamic/cms/src/View/View.php(104): Illuminate\\View\\View->render()
#18 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Responses/DataResponse.php(146): Statamic\\View\\View->render()
#19 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Responses/DataResponse.php(42): Statamic\\Http\\Responses\\DataResponse->contents()
#20 /Users/x/Sites/x/vendor/statamic/cms/src/Taxonomies/Taxonomy.php(389): Statamic\\Http\\Responses\\DataResponse->toResponse(Object(Illuminate\\Http\\Request))
#21 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Routing/Router.php(902): Statamic\\Taxonomies\\Taxonomy->toResponse(Object(Illuminate\\Http\\Request))
#22 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Routing/Router.php(887): Illuminate\\Routing\\Router::toResponse(Object(Illuminate\\Http\\Request), Object(Statamic\\Eloquent\\Taxonomies\\Taxonomy))
#23 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Routing/Router.php(807): Illuminate\\Routing\\Router->prepareResponse(Object(Illuminate\\Http\\Request), Object(Statamic\\Eloquent\\Taxonomies\\Taxonomy))
#24 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#25 /Users/x/Sites/x/vendor/statamic/cms/src/StaticCaching/Middleware/Cache.php(70): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#26 /Users/x/Sites/x/vendor/statamic/cms/src/StaticCaching/Middleware/Cache.php(62): Statamic\\StaticCaching\\Middleware\\Cache->handleRequest(Object(Illuminate\\Http\\Request), Object(Closure))
#27 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Cache/Lock.php(131): Statamic\\StaticCaching\\Middleware\\Cache->Statamic\\StaticCaching\\Middleware\\{closure}()
#28 /Users/x/Sites/x/vendor/statamic/cms/src/StaticCaching/Middleware/Cache.php(62): Illuminate\\Cache\\Lock->block(30, Object(Closure))
#29 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\StaticCaching\\Middleware\\Cache->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#30 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/AuthGuard.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#31 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\AuthGuard->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#32 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/AddViewPaths.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#33 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\AddViewPaths->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#34 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/Localize.php(38): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#35 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\Localize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#36 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/HandleToken.php(13): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#37 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\HandleToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#38 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/StacheLock.php(29): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#39 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\StacheLock->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#40 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(51): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#41 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#42 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(88): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#43 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#44 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#45 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#46 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#47 /Users/x/Sites/x/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))
#48 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#49 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#50 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#51 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(75): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#52 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#53 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#54 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Routing/Router.php(807): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#55 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Routing/Router.php(786): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#56 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Routing/Router.php(750): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#57 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Routing/Router.php(739): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#58 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(201): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#59 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#60 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/StopImpersonating.php(12): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#61 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\StopImpersonating->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#62 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/DisableFloc.php(17): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#63 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\DisableFloc->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#64 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/CheckMultisite.php(15): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#65 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CheckMultisite->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#66 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/CheckComposerJsonScripts.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#67 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CheckComposerJsonScripts->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#68 /Users/x/Sites/x/vendor/statamic/cms/src/Http/Middleware/PoweredByHeader.php(18): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#69 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\PoweredByHeader->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#70 /Users/x/Sites/x/vendor/livewire/livewire/src/Features/SupportDisablingBackButtonCache/DisableBackButtonCacheMiddleware.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#71 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Livewire\\Features\\SupportDisablingBackButtonCache\\DisableBackButtonCacheMiddleware->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#72 /Users/x/Sites/x/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(66): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#73 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#74 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#75 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#76 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#77 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#78 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(51): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#79 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#80 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#81 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#82 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(110): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#83 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#84 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#85 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\HandleCors->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#86 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#87 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#88 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#89 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#90 /Users/x/Sites/x/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#91 /Users/x/Sites/x/public/index.php(51): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#92 /Applications/Herd.app/Contents/Resources/valet/server.php(167): require('/Users/x...')
#93 {main}
"} 
ryanmitchell commented 1 month ago

Yes, you're right it seems to be passing a site object instead of a handle. However whats strange is that none of those locale methods are touched by eloquent driver, we don't modify the localised term in any way so why you're seeing this on eloquent but not with file based terms is a bit of a mystery.

Beyond the switch to eloquent is there anything further you have done to extend Statamic?

As we are struggling to see the issue ourselves - are you able to provide a basic repository showing the issue that we can use to understand where the source of the problem is coming?

de-raaf-media commented 1 month ago

"Beyond the switch to eloquent is there anything further you have done to extend Statamic?"

No this was a simple page showing the categories. Unfortunately at this time I do not have the time to setup a basic repo. But I will do that as soon as I find the time for this.

de-raaf-media commented 1 month ago

Apparently I had to put "taxonomy:" in front of categories. This is well explained in the v2 docs (https://v2.statamic.com/tags/taxonomy).

Why everything worked before moving them to the database I don't know.

{{ taxonomy:categories }}
{{ entries as="category_entries" }}
{{ if category_entries | count > 0 }}
<div class="column is-3">
    <!-- my product -->
    <p>Number of items: {{ category_entries | count }}</p>
</div>
{{ /if }}
{{ /entries }}
{{ /taxonomy:categories }}
ryanmitchell commented 1 month ago

ok - so its working as expected now?

de-raaf-media commented 1 month ago

Yes it is.