Call to a member funtion toRfc822String() on null
Closed this issue · 4 comments
Bug description
Hello,
i have installed this addon in order to get my blog onto a RSS feed. What is weird that at first this addon worked just fine and then suddendly it just stopped working? I recreated the config file to see if starts working again after that but no success. Everytime i now try to access my feed i get this error:
Steps to reproduce
i installed the addon via composer
then i published the config file as told
at first stuff worked but then out of nowhere it stopped working and now always shows that error.
Even after i deleted my own config and republished the default config it still occurs.
Environment and versions
Environment
Application Name: LunarEngine
Laravel Version: 9.50.0
PHP Version: 8.2.12
Composer Version: 2.5.5
Environment: local
Debug Mode: ENABLED
URL: localhost
Maintenance Mode: OFF
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file
Statamic
Addons: 1
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: 4.32.0 Solo
Statamic Addons
mitydigital/feedamic: 2.2.9
Additional details
No response
Can you provide more details, including the yaml for:
- collection config
- blueprint for the collections being included in your feed
@martyf
YAML for the collection config "blog":
title: Blog
template: blogpost
layout: layout
revisions: false
route: '/blog/{{ slug }}'
sort_dir: asc
date_behavior:
past: public
future: private
preview_targets:
-
label: Entry
url: '{permalink}'
refresh: true
YAML for Blueprint
tabs:
main:
display: Main
sections:
-
fields:
-
handle: title
field:
type: text
required: true
validate:
- required
-
handle: blog_date
field:
mode: single
inline: false
full_width: false
columns: 1
rows: 1
time_enabled: false
time_seconds_enabled: false
type: date
display: 'Blog Date'
icon: date
listable: hidden
instructions_position: above
visibility: visible
replicator_preview: true
hide_display: false
-
handle: blog_title
field:
input_type: text
antlers: false
type: text
display: 'Blog Title'
icon: text
listable: hidden
instructions_position: above
visibility: visible
replicator_preview: true
hide_display: false
-
handle: blog_image
field:
max_files: 1
mode: list
container: assets
restrict: false
allow_uploads: true
show_filename: true
show_set_alt: true
type: assets
display: 'Blog Image'
icon: assets
listable: hidden
instructions_position: above
visibility: visible
replicator_preview: true
hide_display: false
-
handle: blog_content
field:
restrict: false
buttons:
- bold
- italic
- unorderedlist
- orderedlist
- quote
- link
- image
- table
automatic_line_breaks: true
automatic_links: false
escape_markup: false
heading_anchors: false
smartypants: false
table_of_contents: false
antlers: false
type: markdown
display: 'Blog Content'
icon: markdown
listable: hidden
instructions_position: above
visibility: visible
replicator_preview: true
hide_display: false
sidebar:
display: Sidebar
sections:
-
fields:
-
handle: slug
field:
type: slug
localizable: true
-
import: seo
title: Blog
When using a Blog (or dated collection like this), there's two things to do:
Firstly, in your Collection configuration, enable "enable publish dates". This will add the following to your blog yaml:
date: true
When you do this, it will add a date
field to your blueprint - just use that - so you will need to remove your blog_date
field - just make sure you update the date
to be the blog_date
values you already have.
This should resolve the issue you're seeing, as that error is occurring when Statamic is trying to get the publish date which relies on the date
field being in your blueprint.
@martyf omg i didn't know.
i thought i had to add it manually. that explains why it suddendly stopped working.
it was because i added the blog_date thing. Tested your solution and can confirm that it now works again.
thank you very much. :)
i am also gonna directly close this as the issue is resolved.