Problem/Motivation
As a feeds administrator whose recent import has caused unwanted changes (updates) to entities with revisions enabled, I want to revert to the revision before the import, so that I can undo the unwanted changes.
In Feeds 7.x-2.x, it is possible to delete all nodes affected by a Feeds import using the "Delete items" tab on the import page. This useful when an importer created nodes. However, if the importer modified existing nodes, it is not desirable to delete them.
If a content type is configured so that new revisions are created by default, and Feeds updates nodes of that content type, then \FeedsNodeProcessor automatically creates a revision named "Updated by FeedsNodeProcessor" when it saves its changes.
Proposed resolution
Provide a bulk operation similar to the "Delete items" tab, which looks through each entity modified during an import, and reverts them to the revision before the "Updated by FeedsNodeProcessor" revision.
Remaining tasks
- Collaborate with #2692945: Add ability to revert imported data (for entities that support it)
- Write tests
- Reviews, feedback
- RTBC, feedback
- Commit
User interface changes
When viewing an import form (at import/%feeds_importer), there is a "Roll back items" tab. Clicking on it presents a similar interface to the "Delete items" tab. Performing the "Roll back" operation goes through each entity modified during the import. If that entity has an "Updated by FeedsNodeProcessor" (etc.) revision, then the node is reverted to the revision before that one.
API changes
The \FeedsSource class gains the following functions:
\FeedsSource::startRollback(), which operates in a similar manner tostartClear()\FeedsSource::scheduleRollback(), which operates in a similar manner toscheduleClear()\FeedsSource::rollback(), which operates in a similar manner toclear()\FeedsSource::progressRollingBack(), which operates in a similar manner toprogressClearing()
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2827836-4-provide-rollback-items-operation.patch | 14.67 KB | mparker17 |
Comments
Comment #2
mparker17Simplify the issue title somewhat.
Comment #3
megachrizI have not read the issue in detail yet, but is this issue perhaps the same as #2692945: Add ability to revert imported data (for entities that support it)?
Comment #4
mparker17@MegaChriz, I wasn't aware that issue existed, but I'll check it out in greater depth shortly.
For now, here's the start of patch for this issue. This patch needs tests; so if it doesn't break any of the existing tests, I'll move it to needs work.
Comment #5
megachrizI've glanced through the code and it looks nifty. Could take me a while before I'm able to do a proper review though. I have also some other Feeds issues on my list that I like to get done. Maybe you could contact nvahalik (who created #2692945: Add ability to revert imported data (for entities that support it)) and work together on this issue as that other issue looks at least very similar.
Comment #6
mparker17@MegaChriz, sounds good.
Moving back to needs work as promised. Updating remaining tasks in issue summary.
Comment #7
bluegeek9 commentedUnfortunately, Drupal 7 is End of Life and no longer supported. We strongly encourage you to upgrade to a supported version of Drupal.