When viewing autocomplete of users (eg VBO action via CiviCRM Entity Actions), we don't want to offer deceased / trashed users.

(Hmm ... maybe sometimes people do ... maybe we should make it a default option, IDK.)

Comments

xurizaemon created an issue. See original summary.

markusa’s picture

So we're moving CiviCRM Entity Actions into the CiviCRM Entity module suite. This particular issue may actually be more related to the Views Bulk Operations functionality. That doesn't necessarily mean that this feature can't be integrated into the module.

xurizaemon and I have discussed this some through other channels, and we'll be looking at it to see what is possible/required.

markusa’s picture

Component: Code » CiviCRM Entity Actions
Category: Task » Feature request
xurizaemon’s picture

The existing VBO autocomplete uses Entity Reference Autocomplete to do the lifting. This time I caught it over there in a custom module for the site in question.

/**
 * Implements hook_entityreference_autocomplete_matches_alter().
 */
function exampleorg_entityreference_autocomplete_matches_alter(&$matches, $context) {
  // We ignore contacts who are deleted or ignored.
  $ignores = array('is_deceased', 'contact_is_deleted');
  foreach ($matches as &$match) {
    foreach ($ignores as $ignore) {
      if (isset($context[$match]['entity']->$ignore) && $context[$match]['entity']->$ignore == 1) {
        unset($matches[$match]);
      }
    }
  }
}

It's plausible that sites might want autocomplete for dead people, so I don't think we want this locked in. Would be really nice if the autocomplete used a view which was then editable though :D

markusa’s picture

Status: Active » Closed (won't fix)