I have just noticed a systematic error running through core ... and I want to also fix this on the contrib modules .. I care about..
If one defines a id variable on a class that extends Plugin ... it inadvertently converts a read-only variable into a read-write variable ... well read, write ( accept and ignore ) variable..
I have a issue in core to remove the 34 bugs.... #2917345: Parallel definition of ID is confusing
Also core sometimes needlessly redefines things like label and title.... and I want to remove that from flag also
#2917213: FieldType: Remove redefinition of label and description
In truth these are all minor ... I think, so I am just going to munge them into one issue here.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2917359-2.patch | 1.54 KB | martin107 |
|
Comments
Comment #2
martin107 CreditAttribution: martin107 as a volunteer commentedNow I have an issue number here is the patch.
Comment #3
martin107 CreditAttribution: martin107 as a volunteer commentedComment #4
socketwench CreditAttribution: socketwench at TEN7 commentedIt makes sense, but I'm wondering why no one in core didn't notice this yet. Maybe there's a reason no one bothered to document? I'm going to mark this as postponed for now until we see what core does.
Comment #5
joachim CreditAttribution: joachim as a volunteer commentedI don't see a problem with redefining these, as it allows us to give them a docblock description that is more specific to how we use them -- instead of 'the entity ID' and 'the entity label' (which given how many entities we have flying around in this module -- Flag, Flagging, Flaggable -- is a good thing).
And I don't see $id defined in core/lib/Drupal/Component/Annotation/Plugin.php.
Comment #7
socketwench CreditAttribution: socketwench at TEN7 commentedYeah...I'm overthinking. The advantage of the docblock is a good one to have too. Committed!
Comment #8
joachim CreditAttribution: joachim as a volunteer commentedCould you revert this please? All of those changes are undesirable.
Comment #10
socketwench CreditAttribution: socketwench at TEN7 commentedDone.
Comment #11
joachim CreditAttribution: joachim as a volunteer commentedThanks!