Problem/Motivation

Removing items related with feed entries en masse to easily prepare multiple feeds for a reimport.

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 deletion of all imported items for every feed that is passed to the action plugin.

The kernel test

The kernel test could be written as follows:

  1. Create feed type. I think using the parser "syndication" (for parsing RSS feeds) is the easiest for this test.
  2. Create two feeds: one that imports drupalplanet.rss2 and another one that imports googlenewstz.rss2. These RSS feeds are found in tests/resources/rss.
  3. Import content for both feeds.
  4. Assert that content has been imported.
  5. Apply the action plugin.
  6. Assert that all content was deleted.

Remaining tasks

  1. Write an action plugin
  2. Write a kernel test that covers the action plugin
  3. Finish and clean up the clear feed action (I assume some tests will fail as of now).
  4. Add test coverage for delete feed action.
  5. Add an update function for installing new config "system.action.feeds_feed_clear_action.yml".

User interface changes

New entry in the 'With selection' dropdown menu:

CommentFileSizeAuthor
#5 Feed-listing.png108.47 KBmegachriz

Issue fork feeds-3165187

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

mxmilkiib created an issue. See original summary.

megachriz’s picture

Title: With selection: Delete items? » Add an action to bulk delete imported items
Related issues: +#3049631: Add an action to bulk import feeds

Good suggestion. I've added your request to #3165018: [meta] Feeds intermediate issues. On that list I try to keep track of issues that aren't too hard to accomplish so developers that have some experience could pick these up.

irinaz’s picture

On each feed you have an option to delete all items for this feed. @mxmilkiib - Is this request to bulk delete all items in all feeds?

mxmilkiib’s picture

A request to be able to bulk delete all items in selected threads.

As in, a new "Delete all items in selected feeds" (or whatever) item in the "With selection" drop-down menu on /admin/content/feed.

megachriz’s picture

Issue summary: View changes
StatusFileSize
new108.47 KB

I've expanded the issue summary a bit. Hopefully, it's now more clear for a contributor about how to work on this issue.

megachriz’s picture

Issue summary: View changes

I've worked some myself on this feature. Was a bit more complicated than I thought. I refactored some code too in the process. Test coverage is added for clearing feeds (delete imported items), but since I touched code for the existing delete feed action, that will need test coverage too.

Next steps:

  • Finish and clean up the clear feed action (I assume some tests will fail as of now).
  • Add test coverage for delete feed action.
  • Add an update function for installing new config "system.action.feeds_feed_clear_action.yml".

megachriz’s picture

Status: Active » Needs review

This is ready for review.

megachriz’s picture

Issue summary: View changes

  • MegaChriz committed 35bea175 on 8.x-3.x
    Issue #3165187 by MegaChriz: Added an action to bulk delete imported...
megachriz’s picture

Status: Needs review » Fixed

Merged the code!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.