The FeedTypeTamperMeta code makes calls to $tamper->getSetting(KEY) in the code, e.g. removeTamper(), updateTamper(), and getTampersGroupedBySource(). However, the Tamper module's plug-ins (and interface) do not have this method define (or required).

This is a critical bug because you can't remove or update Tampers once added.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cgmonroe created an issue. See original summary.

MegaChriz’s picture

You are right. Only the class \Drupal\tamper\ConfigurableTamperBase has this method defined.

MegaChriz’s picture

Status: Active » Needs review
FileSize
10.37 KB

This expands the tests for the FeedTypeTamperMeta class and also changes it's API a bit to be more like how \Drupal\filter\Entity\FilterFormat handles plugins.

I do think that the TamperBase class should have a getSetting() method. Feeds Tamper need to be able to store it's configuration on a Tamper plugin instance. While the configuration can get stored there, it cannot be retrieved by Tamper plugins directly extending TamperBase.

Status: Needs review » Needs work

The last submitted patch, 3: feeds_tamper-tamper-meta-2946698-3.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

ericgsmith’s picture

I've opened a related ticket Make all plugins configurable to make all plugins configurable by default.

I don't see a downside to this approach and will make things a bit more consistent. The feeds UI currently checks for an instance of ConfigurableTamperInterface which would need to be removed before we can remove the deprecated code in tamper if we are happy with the related ticket.

MegaChriz’s picture

Anticipating on the patch in #2948543-3: Make all plugins configurable. Removes references to ConfigurableTamperInterface.

We need UI tests for adding and editing tamper instances. All Feeds Tamper's form code is not covered by any tests.

MegaChriz’s picture

Status: Needs work » Needs review
FileSize
12.96 KB

Status: Needs review » Needs work

The last submitted patch, 7: feeds_tamper-tamper-meta-2946698-7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

ericgsmith’s picture

Status: Needs work » Needs review

Test runs fine locally with the latest patch in https://www.drupal.org/project/tamper/issues/2948543#comment-12522953

@MegaChriz are UI tests blocking this issue or are you happy for me to merge the patch in the tamper module?

The last submitted patch, 6: feeds_tamper-tamper-meta-2946698-6.patch, failed testing. View results

MegaChriz’s picture

UI tests are not blocking this issue. They would be a nice to have to ensure that this patch doesn't break anything, but should it break something then that can also be fixed once the tests are implemented.

I'm happy to have the patch in the Tamper module merged.

MegaChriz’s picture

Reroll (needed after the changes in #2937728: Add an UI) + small change.

Status: Needs review » Needs work

The last submitted patch, 12: feeds_tamper-tamper-meta-2946698-12.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

MegaChriz’s picture

Status: Needs work » Needs review
FileSize
15.02 KB
3.4 KB

Shortened \Drupal\Tests\feeds_tamper\Unit::testSetTamperConfig() as what it tested first only works during a Kernel test. Also a few coding standard fixes.

  • MegaChriz committed c9bfce9 on 8.x-2.x
    Issue #2946698 by MegaChriz, ericgsmith, cgmonroe: Updated Feeds Tamper...
MegaChriz’s picture

Status: Needs review » Fixed

Committed #14.

Status: Fixed » Closed (fixed)

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