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.
It looks like the current SyndicationParser.php only pulls in the item "Description' field which is essentially a summary of the content. There is no way to pull in the full content of the feed item. Attached is a patch which adds this field, using the following code:
Add to $item:
->set('content', $entry->getContent())
Add to 'getMappingSources()':
'content' => [
'label' => $this->t('Content (Atom)'),
'description' => $this->t('Content of the feed item.'),
'suggested' => ['body'],
'suggestions' => [
'targets' => ['body'],
'types' => ['field_item:text_with_summary' => []],
],
],
Comment | File | Size | Author |
---|---|---|---|
#3 | feeds-add-rss-content-field-2641674-10702672-8x.patch | 1.58 KB | mariagwyn |
Comments
Comment #2
mariagwyn CreditAttribution: mariagwyn commentedComment #3
mariagwyn CreditAttribution: mariagwyn commentedAdding patch file.
Comment #4
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedSetting to "Needs review", so the testbot will evaluate the patch. (Note that there is one broken test currently in the 8.x-3.x branch, so 1 test failure may be ignored.)
Comment #6
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedI guess this breaks the test Drupal\Tests\feeds\Unit\Feeds\Parser\SyndicationParserTest. The test failure for Drupal\Tests\feeds\Unit\Feeds\Target\DateTimeTest is a know failure and can be ignored.
Comment #8
twistor CreditAttribution: twistor as a volunteer commentedI did change from 'Content (Atom)' to 'Content' since the content element also applies to RSS. Our parser will even grab the description if the RSS item doesn't have a content element.
Comment #9
twistor CreditAttribution: twistor as a volunteer commented