Skip to content
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

In CategoryFeedView - use article [item] publish date instead of creation date for RSS / ATOM... / #20885

Closed
AndNovAtor opened this issue Jun 27, 2018 · 3 comments

Comments

@AndNovAtor
Copy link
Contributor

AndNovAtor commented Jun 27, 2018

Is your feature request related to a problem? Please describe.

In RSS/Atom feed [category] view (with url - /?format=feed&type=atom), in xml, item creation date is used for <pubDate> / <published> tag instead of publish date. Why? Sorting of the items is still displayed by date of publication, as my blog category view sorting settings.

Describe the solution you'd like

So, I edited \Joomla\CMS\MVC\View\CategoryFeedView , for Joomla 3.8.10 - /libraries/src/MVC/View/CategoryFeedView.php, on line :100,

replace:

if ($createdField)

with:

if (isset($item->publish_up)) { $date = date('r', strtotime($item->publish_up)); } elseif ($createdField)

Additional context

But with my code meaning of $createdField is ignored ($date = isset($item->$createdField) ? date('r', strtotime($item->$createdField)) : '';). So. my code is only workaround for my problem.

P.s. sorry for my English

@AndNovAtor AndNovAtor changed the title In CategoryFeedView - use article [item] publish date instead of creation date for... <pubDate> / <published> In CategoryFeedView - use article [item] publish date instead of creation date for RSS / ATOM... <pubDate> / <published> Jun 27, 2018
@joomla-cms-bot joomla-cms-bot changed the title In CategoryFeedView - use article [item] publish date instead of creation date for RSS / ATOM... <pubDate> / <published> In CategoryFeedView - use article [item] publish date instead of creation date for RSS / ATOM... / Jun 27, 2018
@brianteeman
Copy link
Contributor

I suspect the reason is because the specification states

Typically, atom:published will be associated with the initial
creation or first availability of the resource.

But it does seem more logical for it be first availabilty ie published date

@AndNovAtor
Copy link
Contributor Author

Oh, okey.

for it be first availabilty ie published date

So, what's Joomlas's opinion on this? Because Joomlas's publish up article date can be used for creating news "from the past" (for example, when I migrate news to the new site version and want to "save" RSS from the old site version).
Btw, RSS specification "says":

pubDate The publication date for the content in the channel

@wilsonge
Copy link
Contributor

Closed as there is a PR #21684

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants