Answers.Body: <p>In the end, I removed the "Is Deceased" option from the profile we use to edit the contact's information and created a separate profile which contains only that field. It's a little clunky to present two edit links:</p>
  
  <ul>
  <li>Edit contact information</li>
  <li>Mark contact as deceased</li>
  </ul>
  
  <p>...but it works for now. I would have tried it in a Webform (with <a href="https://www.drupal.org/project/webform_civicrm" rel="nofollow">Webform CiviCRM</a>) but I don't think the image handling pushes back into CiviCRM.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-08T21:48:24.057Z
Answers.LastActivityDate: 2015-04-08T21:48:24.057Z
Answers.UserDisplayName: Laryn
Answers.Body: <p>Since the end goal is to display data in Views, can you use a small module to alter the views query, rather than customizing Civi? I haven't tried views_query_substitutions personally (I've usually hooked into views_query_alter), but I think this is a simple fix that could solve the problem:</p>
  
  <pre><code>function hook_views_query_substitutions($view) {
    // Example from views_views_query_substitutions().
  
    return array(
      "civicrm_contact.is_deceased = '0'" =&gt; "civicrm_contact.is_deceased = '0' OR civicrm_contact.is_deceased IS NULL",
    );
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-08T21:44:42.583Z
Answers.Text: I gave it a quick try and it didn't take but I appreciate the idea. I will keep this in my back pocket for the future but can't devote too much time to this minor issue.
Answers.UserDisplayName: Laryn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-07T15:56:04.017Z
Answers.LastActivityDate: 2015-04-07T15:56:04.017Z
Answers.UserDisplayName: Nicholai
Body: <p>We have a simple directory built with Views and a few exposed filters for searching. One of the (non-exposed) filters is intended to make sure all listed contacts are not marked as deceased. However, the filter does not have a negate option so instead of <code>Is Deceased NOT TRUE</code> we have to do <code>Is Deceased FALSE</code>. We may have even had to set the 'Is Deceased' field to 0 in the database directly, I can't recall. That part was working fine.</p>
  
  <p><img src="https://i.sstatic.net/oJtkS.jpg" alt="&#39;Is deceased&#39; filter in views"></p>
  
  <p>However, we also have a simple profile set up to allow editing of the contacts, adding a photo, and marking as deceased as necessary. What we've found is that when a contact is edited (to update the address or add a photo for example), the "Is Deceased" field is reset to NULL and this excludes them from the directory (because the field does not equal FALSE anymore).</p>
  
  <p>What is a better way to handle this?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-07T20:44:17.490Z
Comments.Text: This seems like a general problem with views integration - civicrm boolean yes/no fields often need a more complex selection than True or False.
Comments.UserDisplayName: Alan Dixon
Tags: <drupal><profile><drupal-views>
Title: "Is deceased" checkbox and Views
ThreadText: # "Is deceased" checkbox and Views
  
  (Asked by: username_0 on 2015-04-07)
  
  We have a simple directory built with Views and a few exposed filters for searching. One of the (non-exposed) filters is intended to make sure all listed contacts are not marked as deceased. However, the filter does not have a negate option so instead of `Is Deceased NOT TRUE` we have to do `Is Deceased FALSE`. We may have even had to set the 'Is Deceased' field to 0 in the database directly, I can't recall. That part was working fine.
  
  !['Is deceased' filter in views](https://i.sstatic.net/oJtkS.jpg)
  
  However, we also have a simple profile set up to allow editing of the contacts, adding a photo, and marking as deceased as necessary. What we've found is that when a contact is edited (to update the address or add a photo for example), the "Is Deceased" field is reset to NULL and this excludes them from the directory (because the field does not equal FALSE anymore).
  
  What is a better way to handle this?
  
  **Tags:** drupal, profile, drupal-views
  
  > **Comments:**
  > **username_1**: This seems like a general problem with views integration - civicrm boolean yes/no fields often need a more complex selection than True or False.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2015-04-08. Score: 2 | Accepted answer
  
  In the end, I removed the "Is Deceased" option from the profile we use to edit the contact's information and created a separate profile which contains only that field. It's a little clunky to present two edit links:
  
  * Edit contact information
  * Mark contact as deceased
  
  ...but it works for now. I would have tried it in a Webform (with [Webform CiviCRM](https://www.drupal.org/project/webform_civicrm)) but I don't think the image handling pushes back into CiviCRM.
  
  
  ---
  
  ### Answer by username_2 on 2015-04-07. Score: 1
  
  Since the end goal is to display data in Views, can you use a small module to alter the views query, rather than customizing Civi? I haven't tried views\_query\_substitutions personally (I've usually hooked into views\_query\_alter), but I think this is a simple fix that could solve the problem:
  
  ```
  function hook_views_query_substitutions($view) {
    // Example from views_views_query_substitutions().
  
    return array(
      "civicrm_contact.is_deceased = '0'" => "civicrm_contact.is_deceased = '0' OR civicrm_contact.is_deceased IS NULL",
    );
  }
  
  ```
  
  > **Comments:**
  > **username_0**: I gave it a quick try and it didn't take but I appreciate the idea. I will keep this in my back pocket for the future but can't devote too much time to this minor issue.  
  
  ---
  
  