statamic / cms

The core Laravel CMS Composer package
https://statamic.com
Other
4.05k stars 530 forks source link

Taxonomy isn't working for AMP #2095

Closed twd3 closed 2 years ago

twd3 commented 4 years ago

If I try to visit a taxonomy through AMP it gives 500 error and this in the log "local.ERROR: Call to undefined method Statamic\Taxonomies\LocalizedTerm::ampable()".

So if I try to view something like: domain.com/amp/blog/tags/the-tag it fails.

Turn on AMP for collection. Make sure collection uses taxonomy. Go view taxonomies amp versions.

Environment

Statamic version: 3.0.0.-beta-37

PHP version: 7.3

Install method:

twd3 commented 4 years ago

This log error might have to do with it:

[2020-10-21 15:51:04] production.ERROR: Call to undefined method Statamic\Taxonomies\LocalizedTerm::ampable() {"userId":"0e51cd0d-d8ef-4960-abbb-b8ceeaee1566","exception":"[object] (Error(code: 0): Call to undefined method Statamic\\Taxonomies\\LocalizedTerm::ampable() at /home/forge/domain.com/vendor/statamic/cms/src/Http/Responses/DataResponse.php:78)
[stacktrace]
#0 /home/forge/domain.com/vendor/statamic/cms/src/Http/Responses/DataResponse.php(42): Statamic\\Http\\Responses\\DataResponse->handleAmp()
#1 /home/forge/domain.com/vendor/statamic/cms/src/Taxonomies/LocalizedTerm.php(333): Statamic\\Http\\Responses\\DataResponse->toResponse()
#2 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(744): Statamic\\Taxonomies\\LocalizedTerm->toResponse()
#3 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(731): Illuminate\\Routing\\Router::toResponse()
#4 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(685): Illuminate\\Routing\\Router->prepareResponse()
#5 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#6 /home/forge/domain.com/vendor/statamic/cms/src/StaticCaching/Middleware/Cache.php(29): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#7 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\StaticCaching\\Middleware\\Cache->handle()
#8 /home/forge/domain.com/vendor/statamic/cms/src/Http/Middleware/Localize.php(22): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#9 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\Localize->handle()
#10 /home/forge/domain.com/vendor/jimblue/htmlmin/src/Middlewares/CompressHtml.php(29): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#11 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Jimblue\\HtmlMin\\Middlewares\\CompressHtml->handle()
#12 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#13 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#14 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(77): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#15 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#16 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#17 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#18 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#19 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(62): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#20 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Session\\Middleware\\StartSession->handle()
#21 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#22 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#23 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#24 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#25 /home/forge/domain.com/vendor/statamic/cms/src/StaticCaching/Middleware/Retrieve.php(34): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#26 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\StaticCaching\\Middleware\\Retrieve->handle()
#27 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#28 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(687): Illuminate\\Pipeline\\Pipeline->then()
#29 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\\Routing\\Router->runRouteWithinStack()
#30 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(628): Illuminate\\Routing\\Router->runRoute()
#31 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(617): Illuminate\\Routing\\Router->dispatchToRoute()
#32 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\\Routing\\Router->dispatch()
#33 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#34 /home/forge/domain.com/vendor/statamic/cms/src/Http/Middleware/CheckMultisite.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#35 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\CheckMultisite->handle()
#36 /home/forge/domain.com/vendor/statamic/cms/src/Http/Middleware/PoweredByHeader.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#37 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\PoweredByHeader->handle()
#38 /home/forge/domain.com/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(60): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#39 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle()
#40 /home/forge/domain.com/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#41 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\\Proxy\\TrustProxies->handle()
#42 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#43 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#44 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#45 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#46 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#47 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#48 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(63): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#49 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle()
#50 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#51 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(140): Illuminate\\Pipeline\\Pipeline->then()
#52 /home/forge/domain.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(109): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#53 /home/forge/domain.com/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle()
#54 {main}
"} 
github-actions[bot] commented 3 years ago

This issue has not had recent activity and has been marked as stale — by me, a robot. Simply reply to keep it open and send me away. If you do nothing, I will close it in a week. I have no feelings, so whatever you do is fine by me.

twd3 commented 3 years ago

As far as I know, this is still an issue. I wouldn't close it.

jackmcdade commented 2 years ago

At this point with AMP being officially dead, I think it's best if we focus on other issues here and start the depreciation process for the feature.