Updated: Comment #N
Problem/Motivation
#2184951: Allow plugins to declare themselves a derivative broke the data provided by some plugin derivatives. take views row plugins as an example. CommentRow defines just a plugin ID of 'entity:comment' in its annotation, every other key will use the default values, as defined in the ViewsRow annotation class. This includes stuff like title = ''. So when the base plugin definition is merged with the derivative plugin definition, this wins, so the derivative definition that contains the correct title gets lost. If a value is declared on the base plugin it makes sense to keep it, but not if they are empty.
Proposed resolution
Modify DerivativeDiscoveryDecorator::getDerivatives to first filter the base plugin definition for empty values, then merge with the derivative definition (so any non empty values there are used), then finally merge this again with the base plugin definition to add back any empty keys that the derivative didn't take care of.
Remaining tasks
Test coverage, fix. patch. review. blah blah.
User interface changes
None
API changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2221037-views-ui.png | 41.61 KB | damiankloip |
| #1 | 2221037-PASS.patch | 7.74 KB | damiankloip |
| #1 | 2221037-tests-only-FAIL.patch | 5.45 KB | damiankloip |
Comments
Comment #1
damiankloip commentedWith a failing test and a fix.
Oh, and there is a fix in Views for the 'Missing row plugin' string and this was saying 'Missing style plugin' for a row plugin - The reason I found this issue to start with!
Comment #2
damiankloip commentedAlso, here is what is currently happening in the views UI:
The Missing text should say row, and not style. But also the row plugin is totally there, but has this empty title. So should be 'Content | Settings'.
Comment #4
dawehnerI am sorry but this is duplicate of #2188031: Missing row plugin in views ui