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

Comments

damiankloip’s picture

StatusFileSize
new5.45 KB
new7.74 KB

With 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!

damiankloip’s picture

StatusFileSize
new41.61 KB

Also, 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'.

The last submitted patch, 1: 2221037-tests-only-FAIL.patch, failed testing.

dawehner’s picture

Status: Needs review » Closed (duplicate)

I am sorry but this is duplicate of #2188031: Missing row plugin in views ui