Closed josephrlee closed 2 years ago
That looks like it is trying to reference the old Controller name and namespace (StatamicRssFeed) - like its still trying to load the old package.
Did you run composer update
after updating the composer.json file? And have you made sure that the old package is not listed at all?
Running composer update
from v1.x to v2.0 removes the /vendor/mitydigital/statamic-rss-feed
folder and replaces it with the /vendor/mitydigital/feedamic
folder.
I can't replicate this myself following the steps of the upgrade guide - I update the composer file, update composer, rename the config and it all works as expected.
Let me know how you go, and if you have any other clues or code that can help resolve this.
@martyf, yup I went through the update process. I even deleted the entire vendor folder and composer. lock file and tried to run a fresh install.
The one thing that still referenced the old add-on was in an .antlers.json file.
{"packageName":"mitydigital\/statamic-rss-feed","tags":[{"sourceFile":"\/Users\/josephl\/Sites\/CRISTA\/worldconcern-statamic\/vendor\/mitydigital\/statamic-rss-feed\/src\/ServiceProvider.php","handle":"service_provider","name":"boot","compound":"service_provider:boot","showInCompletions":true,"parameters":[]},{"sourceFile":"\/Users\/josephl\/Sites\/CRISTA\/worldconcern-statamic\/vendor\/mitydigital\/statamic-rss-feed\/src\/Tags\/RssAutoDiscovery.php","handle":"rss_auto_discovery","name":"rss_auto_discovery","compound":"rss_auto_discovery","showInCompletions":true,"parameters":[]}],"modifiers":[],"augmentContributions":[],"queryScopes":[],"viewModels":[]}
A google showed that antlers.json comes from the Antlers Toolbox for VS Code, does that sound right to you?
I'm not a VS Code user so don't have experience with this.
Is there something you need to do that will refresh this file based on what's installed?
Ahh, that makes sense. Yes, I do use that extension, but I don't think it has any bearing on the error. Just tried uninstalling and reinstalling it.
How strange. What does your composer.json file look like?
{
"name": "statamic/statamic",
"description": "Statamic",
"keywords": [
"statamic",
"cms",
"flat file",
"laravel"
],
"type": "project",
"require": {
"php": "^7.3 || ^8.0",
"doublethreedigital/duplicator": "^2.1",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.10",
"laravel/tinker": "^2.7",
"league/flysystem-aws-s3-v3": "^3.0",
"mitydigital/feedamic": "^2.0",
"rias/statamic-redirect": "^2.1.1",
"spatie/statamic-responsive-images": "^2.11.0",
"statamic/cms": "3.3.10",
"statamic/seo-pro": "3.1.0",
"visuellverstehen/statamic-classify": "^2.3"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.6",
"fakerphp/faker": "^1.9.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10",
"spatie/laravel-ignition": "^1.2"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"composer/package-versions-deprecated": true,
"pixelfear/composer-dist-plugin": true
}
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"pre-update-cmd": [
"Statamic\\Console\\Composer\\Scripts::preUpdateCmd"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi",
"@php artisan statamic:install --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
]
}
}
Does this happen when accessing any URL, i.e. even an entry? Or just the feed?
If other pages (like an entry) are working, and you're using the {{ feedamic }}
tag, do you see the RSS/Atom paths in your page source? In other words, is the Feedamic tag working?
Just for fun, remove Feedamic (composer remove mitydigital/feedamic
), and try to access one of your feed URLs - do you get a 404, or does it try to load something?
I've done an install based on your composer.json, and besides needing to install the Cors package, had no issues - install, copy config (so I can set the "pages" collection) and then the feed URLs are loading.
Nope, just happens when I try to go /feed
The {{ feedamic }}
tag is working, here's a screenshot of the homepage source:
I ran the composer remove
command and I still get the same error on the /feed url.
Here's my feedamic.php config file if that helps:
return [
/*
|--------------------------------------------------------------------------
| Routes
|--------------------------------------------------------------------------
|
| Ability to define Atom and RSS feed routes.
|
| The key is the feed type, and the value is the route.
|
| By default, an atom and RSS 2.0 feed will be generated.
|
| Remove from the array to disable a specific feed type.
|
*/
'routes' => [
'atom' => '/feed/atom',
'rss' => '/feed'
],
/*
|--------------------------------------------------------------------------
| Collections
|--------------------------------------------------------------------------
|
| An array of collections to include in the feed.
|
*/
'collections' => [
'villages',
'pages',
'donation_pages',
'press_release'
],
/*
|--------------------------------------------------------------------------
| Cache Key
|--------------------------------------------------------------------------
|
| The base cache key for output. Will be cached forever until EventSaved is fired.
|
*/
'cache' => 'statamic-xml-sitemap',
/*
|--------------------------------------------------------------------------
| Title
|--------------------------------------------------------------------------
|
| The title for the feed
|
*/
'title' => 'World Cocnern',
/*
|--------------------------------------------------------------------------
| Description
|--------------------------------------------------------------------------
|
| The description (RSS) or subtitle (Atom) for the feed
|
*/
'description' => 'World Concern RSS feed.',
/*
|--------------------------------------------------------------------------
| Summary
|--------------------------------------------------------------------------
|
| A list of blueprint fields to look at to try to build the "summary" for the feed.
|
| This is ordered - the first field will be looked first, then the second, etc.
|
| When content is found, it will be used, and other fields will be ignored.
|
*/
'summary' => [
'description',
'banner_copy'
],
/*
|--------------------------------------------------------------------------
| Image
|--------------------------------------------------------------------------
|
| Configuration options for the image to be injected in to the "summary" for the entry.
|
| This only applies when Summary is being used.
|
| The Fields behave like summary - a cascading list of image fields to look at. You can specify the width
| and height too to use for the image generation. If omitted, will be 1280 x 720.
|
| Disable this by setting to false.
|
*/
'image' => [
'fields' => [
'banner_image_seo'
],
'width' => 1280,
'height' => 720
],
/*
|--------------------------------------------------------------------------
| Author
|--------------------------------------------------------------------------
|
| Sets the lookup of an author field.
|
| Set to "false" to disable looking for author details.
|
| If used,
| "handle" defines the blueprint reference to the author, a Statamic user
| "email", when true, will output the <email> for atom feeds
| "name", a pattern to use to build the name output
|
| For "name", each handle is in square brackets, and is used to concatenate fields if you are using
| or want to customise the name output. For example, "[name_first] [name_last]" would pick "name_first"
| and "name_last" from the User.
|
*/
'author' => [
'handle' => 'author',
// true to include the email in the feed, false to exclude - atom only
'email' => false,
// the name pattern to use for the author name
'name' => '[name]',
],
/*
|--------------------------------------------------------------------------
| Copyright
|--------------------------------------------------------------------------
|
| A string to output to the <copyright> (RSS) or <rights> (Atom) feed.
|
| False will exclude this element.
|
*/
'copyright' => false,
/*
|--------------------------------------------------------------------------
| Language
|--------------------------------------------------------------------------
|
| Marks the feed as being in a specific language.
|
| As Atom, using xml:lang, can use more language definitions than the RSS specification, refer to the
| RSS specification for suitable codes:
| https://www.rssboard.org/rss-language-codes
|
*/
'language' => 'en'
];
Does php artisan route:list
show the feed
and feed/atom
routes?
If so, is it looking at the Feedamic package and controller? Or the StatamicRssFeed package?
Hmm, it gives me an error message:
Illuminate\Contracts\Container\BindingResolutionException
Target class [Parfaitementweb\StatamicPodcastPublisher\Http\Controllers\PodcastController] does not exist.
at vendor/laravel/framework/src/Illuminate/Container/Container.php:877
873▕
874▕ try {
875▕ $reflector = new ReflectionClass($concrete);
876▕ } catch (ReflectionException $e) {
➜ 877▕ throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
878▕ }
879▕
880▕ // If the type is not instantiable, the developer is attempting to resolve
881▕ // an abstract type such as an Interface or Abstract Class and there is
1 [internal]:0
Illuminate\Foundation\Console\RouteListCommand::Illuminate\Foundation\Console\{closure}(Object(Illuminate\Routing\Route))
+13 vendor frames
15 [internal]:0
Illuminate\Foundation\Console\RouteListCommand::Illuminate\Foundation\Console\{closure}(Object(Illuminate\Routing\Route))```
Ohhh, I think this might be related to trying to install a previous add-on called: Parfaitementweb\StatamicPodcastPublisher
Which also did some feed stuff.
Maybe it override a route path somewhere, or there are remnants in your project?
Yes, I just tried clearing my route cache by runing: php artisan route:cache
and now it all works!! Thanks for being so responsive!
Woohoo! No worries at all - timezone probably is working in your favour (and get started early these days). Glad it's all working now 👍
Also, in the super off chance someone else runs into this issue, it'd be helpful to add to the docs a note to clear the route cache.
Done, thanks: added a note about caching... although just about your earlier comment, if you're working locally maybe try php artisan route:clear
and not cache them during dev? I only use route:cache
on production.
Oh cool, I'm pretty new to working with Laravel, so thanks for the tip/feedback!
No stress - leaving caching disabled locally (routes, config, etc) is good for development - otherwise you have some odd head scratching debugging moments. But on production, cache away!
Just ran through the upgrade guide to v2, but I'm getting an error.
Here's a link to the error output: https://flareapp.io/share/dPboRWE7#F44
I have Statamic 3.3.10 installed
And Laravel 9.10
Here's a stacktrace: