Problem/Motivation

In #3477520: Add support for PHP attributes for EncryptionMethod plugins, we added an attribute class. However, I didn't realize that as described in the change record, the attribute class actually needs to be specified in EncryptionMethodManager or it won't be picked up.

However, making this change (I think) requires Drupal 10.2 or higher, which means that to adopt this, the module has to end support for lots of older versions of Drupal.

So I'm going to add this MR, but set it to "postponed" until the module is ready to move to 10.2+.

UPDATE: Not providing an attribute is now deprecated in Drupal 11.2, and is a requirement for Drupal 12: https://www.drupal.org/node/3395582

Issue fork encrypt-3484254

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

ptmkenny created an issue. See original summary.

ptmkenny’s picture

Title: Convert from annotations to attributes in Encryption plugins » EncryptionMethodManager needs to specify the Attribute class

ptmkenny’s picture

Title: EncryptionMethodManager needs to specify the Attribute class » 12: EncryptionMethodManager needs to specify the Attribute class
Issue summary: View changes
ptmkenny’s picture

Status: Postponed » Needs review

Drupal 12 is on the way.

alexpott made their first commit to this issue’s fork.

alexpott’s picture

Status: Needs review » Needs work

Let's convert \Drupal\encrypt_test\Plugin\EncryptionMethod\AsymmetricalEncryptionMethod and \Drupal\encrypt_test\Plugin\EncryptionMethod\ConfigTestEncryptionMethod to prove that attributes are actually working. We can leave \Drupal\encrypt_test\Plugin\EncryptionMethod\TestEncryptionMethod will the annotation to prove we've not broken that.

ptmkenny’s picture

Status: Needs work » Needs review

@alexpott Made the conversion as you requested, and added a note to the plugin that we will keep using annotations to not convert it until we drop annotations support.

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

This looks great.

  • alexpott committed 36fbf1c3 on 8.x-3.x
    task: #3484254 EncryptionMethodManager needs to specify the Attribute...
alexpott’s picture

Title: 12: EncryptionMethodManager needs to specify the Attribute class » EncryptionMethodManager needs to specify the Attribute class
Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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