Problem/Motivation

There are some helpful views field plugins that provide the label for payment method, status, etc. The code however assumes that there will always be a value, and they fatal if none is available.

This would occur for example if you have a view for an entity that has an entity reference field to the payment entity, however the views relationship is not required (ie. some entities have payments and some do not).

Proposed resolution

The solution is to check for the value first and return NULL if none is provided.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yanniboi created an issue. See original summary.

yanniboi’s picture

Status: Active » Needs review
FileSize
2.88 KB
yanniboi’s picture

This might be a good opportunity to add an abstract views field plugin label class for the above to implement. We could basically abstract the entire render method out because it is virtually identical for each of the label classes.

yanniboi’s picture

If you like the abstract class idea. This is a patch for it. However I am happy either way.

yanniboi’s picture

FileSize
8.72 KB

Ahh I missed the class out... Here is the correct patch for the abstract base class.

Status: Needs review » Needs work

The last submitted patch, 5: views_plugin_label-2902006-5.patch, failed testing. View results