Problem/Motivation
When you want to import content for multiple feeds, it would be handy to be able to select the feeds you want to import content for at admin/content/feed and apply an action to them to trigger an import for them all.
Proposed resolution
An action plugin and a kernel test that covers the action plugin should be written.
The action plugin
Add a file to src/Plugin/Action and implement an action plugin that triggers the batch import for every feed that is passed to the action plugin.
The action plugin should call startBatchImport() on the feed.
The kernel test
The kernel test could be written as follows:
- Create feed type. I think using the parser "syndication" (for parsing RSS feeds) is the easiest for this test.
- Create two feeds: one for which drupalplanet.rss2 is selected as a source and another whose source is googlenewstz.rss2. These RSS feeds are found in tests/resources/rss.
- Apply the action plugin.
- Assert that content for both feeds was imported.
Remaining tasks
- Write an action plugin
- Write a kernel test that covers the action plugin
User interface changes
New entry in the 'With selection' dropdown menu:

Original report by SocialNicheGuru
On admin/content/feed, I only have the option to delete feeds.
Is there a way to bulk import feeds or to update them all?
Issue fork feeds-3049631
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
Comment #2
megachrizNo, not yet without custom code.
With custom code, you would load each feed you want to update and then call either
startBatchImport()(to import using the UI) orstartCronImport()(to import during cron runs). For small feeds you can also callimport()on it, which performs the whole import in one go.Note that when using cron to import, imports would run kinda simultaneously. So the import for the second feed starts before the import for the first feed is completed (unless the first feed only has one item to import).
I'm not sure if this also the case for the batch import. I think in this case, the imports would run after each other.
Comment #3
megachrizI've expanded the issue summary a bit, so it hopefully becomes more clear for contributors on how to work on this issue.
Comment #4
megachrizI've got #3165187: Add an action to bulk delete imported items ready for review. I plan to pick this one up as well now, and base it on the code introduced by the other issue.
Comment #6
megachrizThis is ready for review.
Comment #8
megachrizI merged the code!
Comment #10
kopeboyGreat! Thank you @MegaCriz !!
Comment #11
kopeboyIs it possible to add the "Import in background" action as well?
Comment #12
megachriz@kopeboy
I had thought about that, but the issue is then that the order in which imports run could feel a bit random. When you would start multiple background imports at once, these imports are kinda run in parallel. This is namely how that would work:
and so forth. So this is not pure in "parallel", but imports for multiple feeds alternate.
The chunks can also differ in size. So maybe the import for feed 1 takes more time to process, so a single chunck for that could be 50 items on average, while for feed 2 it could be 150 items on average per chunk.
But of course we could "fix" all this with a message "Background imports run in parallel" or something similar.
Do you want to create a new issue for this, @kopeboy?