I love this project... it is really useful for copying snippets of code....

Therefore I want to ensure that we are always bug free.

The definition of Drupal\plugin_type_example\Annotation\Sandwich:id introduces a small issue.

It corrupts the existing definition of id - making it writable.

Sandwich extends Plugin which picks up PLugin::getId() -- which is the mechanism designed to ensure it is as read only variable.

This mistake ripples all over core .. and contrib.

I am trying to take it out of core here #2917345: Parallel definition of ID is confusing

CommentFileSizeAuthor
#2 2917385-2.patch518 bytesmartin107
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

martin107 created an issue. See original summary.

martin107’s picture

Assigned: martin107 » Unassigned
Status: Active » Needs review
FileSize
518 bytes

Now I have a issue number .. here is the patch.

  • Mile23 committed 6cccc5c on 8.x-1.x authored by martin107
    Issue #2917385 by martin107: Sandwich:id - make it read-only
    
Mile23’s picture

Status: Needs review » Fixed

I think this is probably a good change. We have this test:

$plugin = $manager->createInstance('ham_sandwich', ['of' => 'configuration values']);

This would fail if the ID is not parsed from our sandwich plugins.

Committed and pushed. Thanks!

Status: Fixed » Closed (fixed)

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