Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Even if #715146: Convert common syndication parser library to a class is abandoned basically, we can improve slightly the pluggability of the Common Syndication parser.
Comments
Comment #1
Aron NovakComment #2
sardara CreditAttribution: sardara at Randstad Digital commentedWith the patch provided in #1 I get a type hint error because
_parser_common_syndication_RSS20_parse()
is passing the $news variable which has been casted to array at that point. I'm providing a new patch to handle that.Comment #3
hmdnawaz CreditAttribution: hmdnawaz commentedUpdated the patch for the latest 7.x-2.x version.
Comment #5
hmdnawaz CreditAttribution: hmdnawaz commentedComment #6
hmdnawaz CreditAttribution: hmdnawaz commentedPatch for version
7.x-2.0-beta4
Comment #7
MegaChriz CreditAttribution: MegaChriz as a volunteer commented@hmdnawaz
Would you like to add automated tests for this feature as well? The tests would need to cover that an item is alterable through the hook
hook_common_syndication_parser_item_alter()
and that the hook gets invoked for each feed type (rss, atom, rdf).To cover this:
In feeds/tests/feeds there are files for each feed type to parse.