-
Notifications
You must be signed in to change notification settings - Fork 8
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
Error on collections without a Date field #29
Comments
I've confirmed that enabling the Date field on the Collection then makes the feed work for that collection. |
The docs change is straight forward from my end (I've not open sourced that site) to reference dated - I guess I assumed it. I don't feel changing it to use the "updated_at" would make sense as it would change the order of your feed.. but I guess the question is, what is the business case you have for not having a dated collection? i.e. what is it that you're trying to achieve by not having a date field? Just wanting to understand the end goal first. |
It's less that I was deliberately avoiding having a date field for a strong reason, and more that it's an option when creating collections, and on this collection I had no need for one. It's a structured collection, so will always be shown in the structure, rather than sorted by date order. I don't need/want a date shown on the page. And I don't need scheduled publishing. So when presented with the option I simply chose not to have the publish date on the collection. Now I've found it's needed for feedamic, I've added a date field. So my specific issue is fixed, I'm just feeding back user experience for improvements. So, a level 1 improvement would be simply making clear a collection needs a date field. It'd be fine to just do that. A level 2 improvement would be having a graceful fallback in case a collection doesn't have a date field (as it is just a tick box option on the collection config page in core). It wouldn't matter if that graceful fallback was less ideal. It's just that it's better than a confusing error. And, as it happens, in my use case sorting by updated_at would work well, as the content is a knowledge base, and I want a feed of the new and updated content. |
That last sentence is the key one here I think. While it is intended for dated - and can be resolved by having a date(time) on your Entries - I also see what you're trying to do too. My argument for forcing dated collections is that if you literally need to change one letter of a typo in an old entry you may not necessarily want that to be "updated" content in your feed. Where as when it is set on an explicit date(time) field, it's a conscious decision to change its order in the feed. Do you see those cases of a single typo change (for example) updating your feed being an issue or not? Or do you think that an explicit date field makes more sense for the user? Basically I'm fence sitting at the moment and happy to hear more about how it could be used to help drive change - but just learning more about those use cases. |
Yes, in my case, I wouldn't have minded articles popping back up the feed just for very minor changes. It's a big collection of content and resurfacing some of it from time to time is useful. However, I do see that it may not be desired in many use cases. As I say, it may be enough to stop at a level 1 improvement of simply documenting the date requirement. But given that not having a date on a collection is a simple tickbox option in core, it might be more user friendly to have a graceful fallback, even if it's sub-optimal - with the compromises involved being documented - rather than just causing an error that's not very descriptive. |
I'm keeping it as dated for the moment, and have updated the docs. But have tagged this issue for 3.x to include then. |
Bug description
I'm successfully using Feedamic to create multiple feeds of different collections on my Statamic 5.x site. (thanks!)
But I've just hit a problem with creating a feed of a structured collection that doesn't have a Date field.
When navigating to this feed I get an error 'Object of class Illuminate\Support\Carbon could not be converted to int'.
On investigation, I think it's the lack of a Date field that is causing the problem.
In the Feedamic controller it requires a date field to sort the entries rather than sorting by the system
updated_at
metadata.This may well be by design rather than a bug.
But perhaps there could be some minor docs improvements to mitigate this?
In the docs at https://docs.mity.com.au/feedamic/configuration/feeds at the end of the 'Collections' section, could be added "IMPORTANT: This means all collections to be included in feeds must be configured with Publish Dates enabled."
In the comments in feedamic.php could add as line 49: "Each collection must be configured with Publish Dates enabled."
Long term, maybe it'd be desirable to sort by
updated_at
instead when a date field isn't found?Steps to reproduce
Environment and versions
Additional details
Thanks for a great addon!
The text was updated successfully, but these errors were encountered: