The aggregator should be able to parse the enclosure information out of RSS 2.0 feeds. It should be implemented to recognize and display the links to enclosures. If you want to 1 up the competition add the code to determine standard file types mp3, wma, ogg, etc and place a download Icon within the aggregated content.

I have donated and would be willing to help out more to see something like this implemented.

Issue fork drupal-16485

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

antipasto’s picture

StatusFileSize
new35.63 KB

Here's a patch for 4.5.2, but this will be implemented way better in 4.6:
http://writtorrent.sourceforge.net/2005/02/rss-20-feeds-with-enclosures-...

sulleleven’s picture

antipasto-
this doesnt change the aggragator's ability to parse enclosures... which this request is about.
I am going to look at aggregator.module and see what needs to be done.

dries’s picture

Patches should be against CVS HEAD, not against the DRUPAL-4-5 branch.

Uwe Hermann’s picture

I think this is fixed in HEAD. Can someone confirm and close this issue?

budda’s picture

Version: » x.y.z
Assigned: Unassigned » budda

No, it's still not in the 4.7 branch or HEAD. I am working on something to enable this kinda support.

designerbrent’s picture

budda, how is are the changes coming to add enclosure support?

LAsan’s picture

Version: x.y.z » 7.x-dev

budda: Any news on this issue?

Moving to cvs.

budda’s picture

Things got side tracked towards the FeedAPI module, which is being dissected to hopefully go in to Drupal core somehow.

mustafau’s picture

Title: Enclosure Support for Aggregator » Enclosure support for Aggregator
Assigned: budda » Unassigned
Status: Active » Needs review
StatusFileSize
new8.74 KB

Attached patch brings enclosure support to Aggregator.

mustafau’s picture

StatusFileSize
new8.23 KB

Re-roll.

Anonymous’s picture

Status: Needs review » Needs work

The last submitted patch failed testing.

mustafau’s picture

Status: Needs work » Needs review
StatusFileSize
new9.03 KB

Status: Needs review » Needs work

The last submitted patch failed testing.

mustafau’s picture

Version: 7.x-dev » 8.x-dev
robdee’s picture

StatusFileSize
new88.33 KB
  • I am new to this site and not sure where everything supposed to go.
  • Reading this site I cannot yet determine where the development focus is with news aggregation so I must assume the core module is where I look first.
  • Attached is my PDF with coding details I used to add image enclosure support to Aggregator 6.x
danny_joris’s picture

+1
How has this 6 year old feature request never gotten any approval? Or am I missing something?

idiotzoo’s picture

+1
This seems a bit of a no-brainer addition to the core aggregator. In Drupal7 there doesn't seem to be any other way to achieve the same results either, which I think there is in drupal6

Saoirse1916’s picture

I would also love to see this added in, seems commonplace these days.

kathyh’s picture

Status: Needs work » Needs review
StatusFileSize
new7.96 KB

Re-roll of patch #12 from cvs to git. Test: update.php and the sample RSS feed with enclosures is here.

Status: Needs review » Needs work

The last submitted patch, aggregator-enclosure-16485-19.patch, failed testing.

kathyh’s picture

Status: Needs work » Needs review
StatusFileSize
new7.96 KB

This works on my machine - not sure why it doesn't here. In reading, may be the -text on the .tpl.php. Any help appreciated. Thanks.

The last submitted patch, aggregator-enclosure-16485-20.patch, failed testing.

valthebald’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll
alansaviolobo’s picture

Assigned: Unassigned » alansaviolobo

it appears as though the patch is written for D7. will try to rewrite it for D8

jhedstrom’s picture

Version: 8.0.x-dev » 8.1.x-dev

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

CFG OCC’s picture

The organisation I work for has a requirement for enclosure utilisation using D8 core aggregator. I have been charged with producing the solution and have produced an extension to core which is being tested internally at my organisation.

We are planning to deploy a local patch today to ensure the changes are retained, which once tested I will post here.

Many thanks,
Christian

CFG OCC’s picture

StatusFileSize
new16.66 KB
jofitz’s picture

Assigned: alansaviolobo » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll

Setting to Needs Review to run the testbot on @CFG OCC's patch in #32.

Status: Needs review » Needs work

The last submitted patch, 32: 2340-20180510.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

CFG OCC’s picture

StatusFileSize
new16.07 KB

Added latest patch based on feedback from https://www.drupal.org/project/drupal/issues/16485#comment-12620453

Many thanks,
Christian

idebr’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 35: aggregator-enclosure-16485-33.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

stephen-cox’s picture

StatusFileSize
new16.01 KB

I have reviewed the patch, fixed a couple of errors with the fetching and saving of enclosure items and updated code formatting to Drupal standards from the codesniffer results.

Thanks,

Stephen

stephen-cox’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 38: aggregator-enclosure-16485-38.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

CFG OCC’s picture

StatusFileSize
new15.72 KB

We are updating to Drupal 8.6 and therefore I will re-create this patch for 8.6

CFG OCC’s picture

CFG OCC’s picture

StatusFileSize
new15.58 KB
CFG OCC’s picture

jhedstrom’s picture

Issue tags: +Needs tests

Resolving the test failures (and adding new tests to cover the new functionality) will be needed.

  1. +++ b/core/modules/aggregator/src/Entity/Item.php
    @@ -115,9 +116,40 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    +    ¶
    ...
    +  ¶
    
    +++ b/core/modules/aggregator/src/FeedInterface.php
    @@ -19,6 +19,25 @@
    +  ¶
    
    +++ b/core/modules/aggregator/src/ItemInterface.php
    @@ -8,6 +8,14 @@
    +  ¶
    
    @@ -27,6 +35,26 @@ public function getFeedId();
    +  ¶
    

    There are a few whitespace issues in this patch that should be resolved.

  2. +++ b/core/modules/aggregator/src/FeedInterface.php
    @@ -19,6 +19,25 @@
    +  public function getSaveEnclosures();
    ...
    +  public function setSaveEnclosures($saveenclosures);
    
    +++ b/core/modules/aggregator/src/ItemInterface.php
    @@ -27,6 +35,26 @@ public function getFeedId();
    +  public function getEnclosure();
    ...
    +  public function setEnclosure($enclosure);
    

    Adding methods to interfaces will be tricky in order to not break BC. One approach is to add a new interface, then have the Feed class implement both the FeedInterface and the new one. And similarly, a new interface for the Item entity to implement too.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

ComNStay’s picture

Hy,
fist, I'm sorry for my english "so Français" !
I apply the patch but when I update the feed enclosure are getting well, I have the images creates in the enclosure folder but field enclosure in DB still to NULL ...
An idea ?
thank for help ;)

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

stephen-cox’s picture

Status: Needs work » Needs review
StatusFileSize
new19.76 KB

The attached patch defines two new interfaces for aggregator feeds and items that deal with enclosures. It also now saves data to the enclosure DB field.

Using a single DB field for enclosure data is far from ideal because there are a number of things that need to be stored for each enclosure item (the patch stores them as a serialized array). Enclosure data should probably be stored in it's own database table, which likely means implementing enclosures as content entities.

As it stands, this patch will store the URL, type, size and file ID of the enclosure, but this data is only accessible through code (using the getEnclosure() and getEnclosureFile() methods on a feed item). Ideally this data should also be exposed to views so that enclosure media items can be accessed through the UI.

Status: Needs review » Needs work

The last submitted patch, 50: aggregator-enclosure-16485-50.patch, failed testing. View results

r0nn1ef’s picture

I like the idea @stephen-cox had of supporting enclosure as a content entity. The only question is which kind of entity; a custom entity with fields for the enclosure attributes or a file or media entity where the file is brought into the site where Aggregator is running? With a media/file entity, you could have duplicate content issues and with a custom entity, you have etiquette (and possible security) concerns about linking to a file on someone else's site.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

stephen-cox’s picture

StatusFileSize
new20.67 KB

Here's a re-roll of patch #50 with Drupal 9 support.

stephen-cox’s picture

Status: Needs work » Needs review
stephen-cox’s picture

StatusFileSize
new20.73 KB

Updated patch fixing test failures.

ranjith_kumar_k_u’s picture

StatusFileSize
new20.69 KB
new712 bytes

Fixed CS issues

Status: Needs review » Needs work

The last submitted patch, 60: 16485-60.patch, failed testing. View results

stephen-cox’s picture

Status: Needs work » Needs review
StatusFileSize
new22.39 KB

Fixing tests.

Status: Needs review » Needs work

The last submitted patch, 62: aggregator-enclosure-16485-61.patch, failed testing. View results

spokje’s picture

Project: Drupal core » Aggregator
Version: 9.4.x-dev » 1.x-dev
Component: aggregator.module » Code

The aggregator module has been removed from Core in 10.0.x-dev and now lives on as a contrib module.
Issues in the Core queue about the aggregator module, like this one, have been moved to the contrib module queue.

larowlan’s picture

Version: 1.x-dev » 2.x-dev
Issue tags: +Needs reroll

https://docs.laminas.dev/laminas-feed/reader/ (which we use) supports enclosures, and now items are entities, this should be doable - we could add a file field to the item entity and customise the parser

In fact, you could do this on your own without hacking core using existing plugin/entity hooks to modify the parser class and fields.

it-cru’s picture

@larowlan: would be nice to store enclosure URL and maybe other data in aggregator_item table or add method to get this data during import for further processing of imported items.