Problem/Motivation

Drupal Core provides forward and reverse relationship handlers for Entity Reference fields.

Payment Reference fields extend from Entity Reference fields, meaning they can do everything that an Entity Reference field can do.

However, Payment Reference fields have a different field name, so, while the Entity Reference field relationship handlers would work if they were defined, they aren't defined for Payment Reference fields.

Proposed resolution

Implement hook_field_views_data() with the same code as core_field_views_data(), replacing...

  // The code below only deals with the Entity reference field type.
  if ($field_storage->getType() != 'entity_reference') {
    return $data;
  }

... with ...

  // The code below only deals with the Payment reference field type.
  if ($field_type !== 'payment_reference') {
    return $data;
  }

Remaining tasks

  1. Write a patch
  2. Review and feedback
  3. RTBC and feedback
  4. Commit and release

User interface changes

It is now possible to add regular (forward) and reverse relationships with Payment Reference fields.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mparker17 created an issue. See original summary.

mparker17’s picture

Assigned: mparker17 » Unassigned
Issue summary: View changes
Status: Active » Needs review
FileSize
3.85 KB

Here's a patch. Feedback welcome!