Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-10009

Differentiate published/updated dates in Atom feed

    Details

    • Type: Improvement
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.8
    • Fix Version/s: 3.0.9-RC1
    • Component/s: Other
    • Labels:
      None
    • Environment:
      PHP 5.3.3, MySQL 5.0.51a, Firefox 3.5.16, Debian

      Description

      The Atom feed currently displays all dates in atom:updated elements. Instead, I propose to use atom:updated for the date of changes to an entity and atom:published for the date on which an entity was published (in line with their definitions in 4.2.9 and 4.2.15 of RFC4287). My interpretation is as follows:

      For posts: Publish date is post_time, updated date is post_edit_time, if any.
      For topics: Publish date is topic_time, updated date is topic_last_post_time, if any.
      For forums: No Publish date, updated date is forum_last_post_time, if any.

        Issue Links

          Activity

          Hide
          bantu Andreas Fischer added a comment -

          Since all feeds (except the forums_feed) deliver posts as their entries, I think it should be

          published => post_time, updated => (post_edit_time) ? post_edit_time : post_time

          for all of them.

          Using

          $feed_updated_time = max($feed_updated_time, $published, $updated);

          is a good idea, because only that will allow the use of If-Modified-Since as described in PHPBB3-10010.

          Show
          bantu Andreas Fischer added a comment - Since all feeds (except the forums_feed) deliver posts as their entries, I think it should be published => post_time, updated => (post_edit_time) ? post_edit_time : post_time for all of them. Using $feed_updated_time = max($feed_updated_time, $published, $updated); is a good idea, because only that will allow the use of If-Modified-Since as described in PHPBB3-10010.
          Hide
          kevinoid kevinoid added a comment -

          My interpretation of the spec. was that atom:updated denoted an additional event, beyond publication (so if an entity had an atom:updated element, it had been updated). But I can imagine user agents which rely on atom:updated dates for sorting and could behave oddly if they are not present. And the meaning is really not too ambiguous when the atom:published and atom:updated dates are identical. I've added/uploaded the changes to the ticket branch in github.

          You are quite right about the relation to PHPBB3-10010.

          Show
          kevinoid kevinoid added a comment - My interpretation of the spec. was that atom:updated denoted an additional event, beyond publication (so if an entity had an atom:updated element, it had been updated). But I can imagine user agents which rely on atom:updated dates for sorting and could behave oddly if they are not present. And the meaning is really not too ambiguous when the atom:published and atom:updated dates are identical. I've added/uploaded the changes to the ticket branch in github. You are quite right about the relation to PHPBB3-10010.
          Hide
          Oleg Oleg [X] (Inactive) added a comment -

          Should not there always be a published date? And if so one of those conditionals could be replaced with unconditional date output?

          Show
          Oleg Oleg [X] (Inactive) added a comment - Should not there always be a published date? And if so one of those conditionals could be replaced with unconditional date output?
          Hide
          bantu Andreas Fischer added a comment -

          4.1.2. The "atom:entry" Element
          [...]
          atom:entry elements MUST NOT contain more than one atom:published element.
          atom:entry elements MUST contain exactly one atom:updated element.

          Show
          bantu Andreas Fischer added a comment - 4.1.2. The "atom:entry" Element [...] atom:entry elements MUST NOT contain more than one atom:published element. atom:entry elements MUST contain exactly one atom:updated element.
          Hide
          bantu Andreas Fischer added a comment -

          That means that "updated" has to be displayed unconditionally. That's currently the case.

          Show
          bantu Andreas Fischer added a comment - That means that "updated" has to be displayed unconditionally. That's currently the case.
          Hide
          bantu Andreas Fischer added a comment -

          Here is the rest of the relevant parts.

          4.2.9. The "atom:published" Element

          The "atom:published" element is a Date construct indicating an
          instant in time associated with an event early in the life cycle of
          the entry.

          atomPublished = element atom:published

          Unknown macro: { atomDateConstruct }

          4.2.15. The "atom:updated" Element

          The "atom:updated" element is a Date construct indicating the most
          recent instant in time when an entry or feed was modified in a way
          the publisher considers significant. Therefore, not all
          modifications necessarily result in a changed atom:updated value.

          atomUpdated = element atom:updated

          Unknown macro: { atomDateConstruct }

          Publishers MAY change the value of this element over time.

          Show
          bantu Andreas Fischer added a comment - Here is the rest of the relevant parts. 4.2.9. The "atom:published" Element The "atom:published" element is a Date construct indicating an instant in time associated with an event early in the life cycle of the entry. atomPublished = element atom:published Unknown macro: { atomDateConstruct } 4.2.15. The "atom:updated" Element The "atom:updated" element is a Date construct indicating the most recent instant in time when an entry or feed was modified in a way the publisher considers significant. Therefore, not all modifications necessarily result in a changed atom:updated value. atomUpdated = element atom:updated Unknown macro: { atomDateConstruct } Publishers MAY change the value of this element over time.
          Hide
          kevinoid kevinoid added a comment -

          bantu: You are right. I stand corrected.

          nn-: The forum feeds (descending from class phpbb_feed_forums) only have an updated date.

          Show
          kevinoid kevinoid added a comment - bantu: You are right. I stand corrected. nn-: The forum feeds (descending from class phpbb_feed_forums) only have an updated date.
          Hide
          bantu Andreas Fischer added a comment -

          I still think "updated" should be mapped to "post_edit_time" and "published" should be mapped to "post_time", with "updated" falling back to "published" in the output loop.

          What is clear is that right now all <content> tags inside each <entry> tag is a posting (except for class phpbb_feed_forums). It is also clear that <updated> and <published> inside the <entry> tags is supposed to be meta data for what's inside the <content> tag.

          phpbb_feed_news gives you the first posts of all topics in selected news forums.
          phpbb_feed_topics gives you the first posts of all topics.
          phpbb_feed_topics_active gives you last posts of all active topics.

          Thus, setting "updated" to "topic_last_post_time" does not make sense for phpbb_feed_news and phpbb_feed_topics because "topic_last_post_time" can get updated without editing the first post. Thus, <updated> wouldn't be meta data for <content>.

          Show
          bantu Andreas Fischer added a comment - I still think "updated" should be mapped to "post_edit_time" and "published" should be mapped to "post_time", with "updated" falling back to "published" in the output loop. What is clear is that right now all <content> tags inside each <entry> tag is a posting (except for class phpbb_feed_forums). It is also clear that <updated> and <published> inside the <entry> tags is supposed to be meta data for what's inside the <content> tag. phpbb_feed_news gives you the first posts of all topics in selected news forums. phpbb_feed_topics gives you the first posts of all topics. phpbb_feed_topics_active gives you last posts of all active topics. Thus, setting "updated" to "topic_last_post_time" does not make sense for phpbb_feed_news and phpbb_feed_topics because "topic_last_post_time" can get updated without editing the first post. Thus, <updated> wouldn't be meta data for <content>.
          Hide
          bantu Andreas Fischer added a comment -

          Good job, Kevin.

          Show
          bantu Andreas Fischer added a comment - Good job, Kevin.

            People

            • Assignee:
              bantu Andreas Fischer
              Reporter:
              kevinoid kevinoid
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development