pubDate has invalid year format

Created on 10 December 2024, 5 months ago

Problem/Motivation

The pubDate format is being reported as incorrect. From https://www.rssboard.org/rss-validator/docs/warning/ProblematicalRFC822D... it mentions that the year SHOULD be expressed as four digits and currently it is only two.

Steps to reproduce

After creating a RSS feed use the RSS Advisory Board RSS Validator to check it. There are others like the W3C Feed Validation Service as well.

Proposed resolution

Provide another date format configuration that display four digits and use that to format the date.

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom somersoft

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @somersoft
  • Merge request !17#3492994 pubDate has invalid year format → (Open) created by somersoft
  • Pipeline finished with Failed
    5 months ago
    Total: 129s
    #364718
  • Same request from me.
    The two digits year is not reported as incorrect though, but "problematical".
    The feed validates but "interoperability with the widest range of feed readers could be improved", which woud rather be appreciated...

    Why is \DateTimeInterface::RSS not used since it exists?

  • Pipeline finished with Canceled
    3 months ago
    Total: 131s
    #409325
  • 🇬🇧United Kingdom somersoft

    @pbouchereau Good call. I have update the branch.

  • Pipeline finished with Failed
    3 months ago
    Total: 132s
    #409326
  • Pipeline finished with Failed
    3 months ago
    Total: 129s
    #409339
  • Status changed to Needs work about 2 months ago
  • 🇫🇮Finland heikkiy Oulu

    I can verify the same issue. In our case the problem seems to be only with the channel pubDate. Actual item pubDates are correct because we have set a different date format in the field settings.

    At the moment the MR pipeline seems to be failing also and I cannot seem to apply the patch either against 2.3 or 2.x-dev branch.

    Gathering patches for root package.
    Loading composer repositories with package information
    Updating dependencies
    Lock file operations: 0 installs, 1 update, 0 removals
      - Upgrading drupal/views_rss (2.3.0 => dev-2.x 7f1e77a)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 1 install, 0 updates, 0 removals
      - Syncing drupal/views_rss (dev-2.x 7f1e77a) into cache
    Gathering patches for root package.
    Gathering patches for dependencies. This might take a minute.
      - Installing drupal/views_rss (dev-2.x 7f1e77a): Cloning 7f1e77a4f2 from cache
      - Applying patches for drupal/views_rss
        assets/patches/3492994--views-rss--rss-date-format.diff (#3492994 Change date format for RSS feed)
       Could not apply patch! Skipping. The error was: Cannot apply patch assets/patches/3492994--views-rss--rss-date-format.diff
    
  • 🇫🇮Finland heikkiy Oulu

    I tested this patch and I encountered an error where the current date format D, d M Y H:i:s O gets translated based on the Drupal site language.

    When previewing the date format in fi/admin/config/regional/date-time/formats/manage/rfc822_rss it gets translated as Ma, 03 Maa 2025 12:17:14 +0200 and this seems to break the feed and we get a validation error
    "Failed to read requested Feed information. Details: Error in line 15 position 52. An error was encountered when parsing a DateTime value in the XML. clientRequestId: f40f103e-0cb9-4cc4-9d4d-827e9031b7c1"

Production build 0.71.5 2024