Closed (fixed)
Project:
Feeds Tamper
Version:
8.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Apr 2018 at 21:15 UTC
Updated:
21 Jun 2018 at 14:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
irinaz commentedI run the following code but still cannot remove plugin
$feed_type = \Drupal\feeds\Entity\FeedType::load('article_import');
// Load a feed type.
/** @var \Drupal\feeds\FeedTypeInterface */
$feed_type = \Drupal\feeds\Entity\FeedType::load('article_import');
// Get Tamper functionality for this feed type.
/** @var \Drupal\feeds_tamper\FeedTypeTamperMetaInterface */
$tamper_meta = \Drupal::service('feeds_tamper.feed_type_tamper_manager')->getTamperMeta($feed_type);
// Example: get a single Tamper instance.
/** @var \Drupal\tamper\TamperInterface */
$uuid = "6c41bf13-a907-451b-87d8-fa4d465f628a";
$tamper = $tamper_meta->getTamper($uuid);
// Example: remove a tamper instance.
$tamper_meta->removeTamper($tamper);
Comment #3
megachrizI noticed that removing Tamper plugins is broken indeed while I was writing UI tests for Feeds Tamper in #2949203: Add UI tests.
I plan to look at this after #2949203: Add UI tests and #2975427: Add config schema for each Tamper plugin are done.
Comment #4
megachrizComment #5
ericgsmith commentedLooks like the form was passing in the whole tamper plugin rather than the instance id.
I've corrected the calling code here however I wonder if it is also worth renaming removeTamper to be removeTamperInstanceId to provide more clarity? Alternatively we could rename and then also re implement removeTamper to accept a plugin instance rather than the uuid.
Comment #6
irinaz commentedI tested patch, works like a charm, thank you!!
Comment #7
keshavv commentedWorking perfectly . Ready for RTBC
Comment #8
megachrizThanks for the patch, Eric!
In #2949203: Add UI tests I added a functional test for removing a Tamper plugin. I marked the test as skipped there because during writing tests I also encountered this bug. Let's see if I wrote that test well by removing the "markTestIncomplete" mark.
Comment #10
megachrizGuess I wrote that test well. It passed! Committed #8.