Hi,

As we can easily extend the entityrefence behaviour, it would also be usefull to be able to modify results before rendering.

Use case:
- We extend the schema and add an extra text field to the entity reference widget.
- Text field can be filled in freely.
- On rendering we populate the result array to overwrite the referenced entity title.

If we could just populate the results before calling the entity_view() that would be great for use, and future entityreference extension.

See attached patch for this implementation.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

harings_rob created an issue. See original summary.

harings_rob’s picture

Issue summary: View changes
harings_rob’s picture

https://www.drupal.org/sandbox/tortelduif/2677666 is the module we need this patch for.

Chris Matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The 3 year old patch in #1 does not apply to the latest 7.x-1.x-dev and if still relevant needs a reroll.

Checking patch entityreference.module...
error: while searching for:
    }
  }

  switch ($display['type']) {
    case 'entityreference_label':
      $handler = entityreference_get_selection_handler($field, $instance, $entity_type, $entity);

error: patch failed: entityreference.module:1234
error: entityreference.module: patch does not apply

Checking patch plugins/behavior/abstract.inc...
Snehal Brahmbhatt’s picture

Status: Needs work » Needs review
FileSize
1.68 KB

@Chris Matthews, Please review my attached patch, I created it for Entity reference 7.x-1.x-dev version as per requirement mentioned in #4. Hope this will help you!..

Thanks!..