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.
I am being tasked with using an external RSS feed that does not correctly use the Author tag. Its values just contain a first and last name like this:
<author>John Smith</author>
After importing, the field remains blank.
I unfortunately do not have any control over the source RSS feed and cannot fix this.
I am using the RSS/Atom parser.
I have tried using "Author email", "Author name" and a custom source simply called "author" and none were able to parse the value.
What can be done about this?
Comment | File | Size | Author |
---|---|---|---|
#6 | feeds.feed_type.author_test.yml | 1.14 KB | andrewmriv |
Comments
Comment #2
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedHm, if the RSS feed uses the
<author>
tag, then that should just work.<author>
is in the RSS specification. Are you sure that you mapped the value correctly?If you want to select elements from a RSS feed (or other XML files) that are beyond the RSS specification, you'll need to use the XML parser from Feeds extensible parsers.
Custom sources are ignored by the RSS parser. When using this parser, they are only useful for setting default values with Feeds Tamper.
Comment #3
andrewmriv CreditAttribution: andrewmriv commentedHi MegaChriz thanks for the response.
I verified that it was mapped correctly but still does not work.
When modifying a test RSS file, the following did work with the "Author email" and/or "Author name" sources:
When I changed the RSS file back to the following, it stopped importing properly.
<author>John Smith</author>
Note: I was importing into a Body field for my test.
Comment #4
andrewmriv CreditAttribution: andrewmriv commentedComment #5
andrewmriv CreditAttribution: andrewmriv commentedComment #6
andrewmriv CreditAttribution: andrewmriv commentedI have attached a test Feed that can reproduce this error.
This Feed imports into the Article Content Type. The Author is mapped to the Body field.
You can also use the following 2 RSS feeds for testing:
The only difference between these files is Line 23.
RSS 1 has:
<author>John Smith</author>
RSS 2 has:
<author>John@smith.com (John Smith)</author>
I need Feeds to work with RSS 1 for my issue to be solved.