- Issue created by @ptmkenny
- 🇳🇱Netherlands megachriz
Alright, good idea. I think that we can only test this by writing a custom Tamper plugin? Maybe it would be good to have a Tamper plugin using attributes in a test module, so that we can add test coverage for this addition?
- 🇯🇵Japan ptmkenny
Thanks for the super quick response. As for testing this, I just converted all the annotations to attributes in 📌 Add attributes alongside annotations Postponed . That can't be committed until this module requires Drupal > 10.2, but it does give test coverage of the attribute class (since all the tests will be run there with attributes instead of annotations), but then of course the test is in a separate issue instead of in this one, where the class will initially be committed.
- 🇯🇵Japan ptmkenny
Tests in 📌 Add attributes alongside annotations Postponed are failing; those should be fixed before this is committed.
- 🇳🇱Netherlands megachriz
I'm not sure if I want to require Drupal 10.2 yet, so because of that it might be useful to add test coverage for this.
- 🇯🇵Japan ptmkenny
As you referenced in the other issue, TamperManager needs to be updated to match this change record: https://www.drupal.org/node/3395582 →
I'll try to get to this tomorrow. I'll fix this issue and the other one first, and then see about adding a test just for this one.
- 🇯🇵Japan ptmkenny
Hmm, adding this change breaks Drupal 9, so perhaps this issue should be closed in favor of 📌 Add attributes alongside annotations Postponed , which then that issue can be committed someday when support for older versions of Drupal are dropped?
- Status changed to Needs review
8 months ago 1:07am 8 January 2025 - 🇯🇵Japan ptmkenny
Closed in favor of 📌 Add attributes alongside annotations Postponed
- Status changed to Closed: duplicate
8 days ago 11:58am 17 August 2025 - 🇳🇱Netherlands megachriz
I think it is nice if we can add support for attributes now, so I'm reopening this. I do think of dropping Drupal 9 support after the next release.
Also because for Drupal 12 it will be required for plugin types to support attributes: https://www.drupal.org/node/3522776 → . - 🇳🇱Netherlands megachriz
megachriz → changed the visibility of the branch attributes to hidden.
- 🇯🇵Japan ptmkenny
Ok, cool. Should we add the tamper attributes to the existing plugins (without removing the annotations)? I'm pretty sure the only thing this requires is PHP 8.1.
- 🇳🇱Netherlands megachriz
I think that adding Attribute does require Drupal 10.2? Anyway, the Attribute code could be updated in 📌 Add attributes alongside annotations Postponed , though there is a good chance they would need to be updated again when 📌 Make Tamper plugins tell if they require a tamperable item Active gets merged.
@ptmkenny
If you like and have the time, there are a bunch of Tamper issues updated that can be reviewed/tested. :)
I keep track of issues that I work on in a spreadsheet: https://docs.google.com/spreadsheets/d/1cn4vmHosTfxgyI0zlvVv_ce94715eH-m... - 🇳🇱Netherlands megachriz
I think that adding Attribute does require Drupal 10.2?
Because \Drupal\tamper\Attribute\Tamper extends \Drupal\Component\Plugin\Attribute\Plugin. The latter class is not available in Drupal versions before 10.2.