Answers.Body: <p>The "Disable expired relationships" scheduled job should set the is_active field to 0 for relationships with a past end date.</p>
  
  <blockquote>
    <p>A bit of history: Civi has always treated both past and disabled
    relationships as "inactive" however there were inconsistencies in some
    of the code (reports maybe) that were not doing so. I believe Fuzion
    contributed the scheduled job to remedy this</p>
  </blockquote>
  
  <p>(From <a href="https://issues.civicrm.org/jira/browse/CRM-18561?focusedCommentId=89028&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-89028" rel="nofollow noreferrer">a comment on issue CRM-18561</a>. See also <a href="https://forum.civicrm.org/index.php?topic=37176.0" rel="nofollow noreferrer">this forum post</a> for some discussion.)</p>
  
  <p>So it looks to me as though the scheduled job has failed in this case. If you view the job log for this job, are any errors shown? Or anything at the relevant time in the CiviCRM log file in files/civicrm/ConfigAndLog/ ?</p>
  
  <p>Could you test whether the problem occurs on the <a href="http://d46.demo.civicrm.org/" rel="nofollow noreferrer">4.6 demo site</a>?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-13T17:59:32.147Z
Answers.Text: The demo sites have functioning Cron jobs?
Answers.UserDisplayName: ñull
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-14T09:37:02.760Z
Answers.Text: You can go to Administer -> System Settings -> Scheduled Jobs and click more -> Execute Now.
Answers.UserDisplayName: davejenx
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-09T11:39:46.510Z
Answers.Text: False alarm. This works as expected on the demo site and I discovered it works correctly as well on our production site. It was apparently a glitch in this particular instance of the site on my local staging server. Thank you for helping out!
Answers.UserDisplayName: ñull
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-12T09:52:48.593Z
Answers.LastActivityDate: 2017-09-12T09:52:48.593Z
Answers.UserDisplayName: davejenx
Body: <p>Scheduled  <strong>Disable expired relationships</strong> has run succesfully according to the date/time I see in the Scheduled job table. I see a relationship in the disabled relationship section that has an End date older than today, so that seems to work. What I don't understand is that it is still marked "Enabled" in view and edit. </p>
  
  <p>Also when I do an api call on the relationship mentioned before it returns it as an active relationship even though it is expired:</p>
  
  <pre><code>$result = civicrm_api3('Relationship', 'get', array(
    'sequential' =&gt; 1,
    'is_active' =&gt; 1,
    'id' =&gt; 56276,
  ));
  </code></pre>
  
  <p>Response:</p>
  
  <pre><code>    {
      "is_error": 0,
      "version": 3,
      "count": 1,
      "id": 56276,
      "values": [
          {
              "id": "56276",
              "contact_id_a": "24943",
              "contact_id_b": "20992",
              "relationship_type_id": "14",
              "start_date": "1995-01-01",
              "end_date": "2004-01-01",
              "is_active": "1",
              "description": "Support Branch",
              "is_permission_a_b": "0",
              "is_permission_b_a": "0",
              "custom_24": "Res",
              "custom_71": {
                  "S": "S"
              },
              "custom_71_26513": {
                  "S": "S"
              },
              "custom_24_26513": "Res"
          }
      ]
  }
  </code></pre>
  
  <p>How should I understand this? As a bug or a feature? What does the "Enabled" tick box in fact mean? Should I understand it as separate from the start and end date as kind of "override" function? </p>
  
  <p>CiviCRM version is 4.6.27. In case it was a bug, has it been fixed meanwhile?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-14T08:31:55.540Z
Comments.Text: is this related to civicase? or just standard?
Comments.UserDisplayName: petednz - fuzion
Tags: <relationships><scheduled-job>
Title: Relationship disabled by end date but still enabled?
ThreadText: # Relationship disabled by end date but still enabled?
  
  (Asked by: username_0 on 2017-09-11)
  
  Scheduled **Disable expired relationships** has run succesfully according to the date/time I see in the Scheduled job table. I see a relationship in the disabled relationship section that has an End date older than today, so that seems to work. What I don't understand is that it is still marked "Enabled" in view and edit.
  
  Also when I do an api call on the relationship mentioned before it returns it as an active relationship even though it is expired:
  
  ```
  $result = civicrm_api3('Relationship', 'get', array(
    'sequential' => 1,
    'is_active' => 1,
    'id' => 56276,
  ));
  
  ```
  
  Response:
  
  ```
      {
      "is_error": 0,
      "version": 3,
      "count": 1,
      "id": 56276,
      "values": [
          {
              "id": "56276",
              "contact_id_a": "24943",
              "contact_id_b": "20992",
              "relationship_type_id": "14",
              "start_date": "1995-01-01",
              "end_date": "2004-01-01",
              "is_active": "1",
              "description": "Support Branch",
              "is_permission_a_b": "0",
              "is_permission_b_a": "0",
              "custom_24": "Res",
              "custom_71": {
                  "S": "S"
              },
              "custom_71_26513": {
                  "S": "S"
              },
              "custom_24_26513": "Res"
          }
      ]
  }
  
  ```
  
  How should I understand this? As a bug or a feature? What does the "Enabled" tick box in fact mean? Should I understand it as separate from the start and end date as kind of "override" function?
  
  CiviCRM version is 4.6.27. In case it was a bug, has it been fixed meanwhile?
  
  **Tags:** relationships, scheduled-job
  
  > **Comments:**
  > **username_1**: is this related to civicase? or just standard?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-09-12. Score: 3 | Accepted answer
  
  The "Disable expired relationships" scheduled job should set the is\_active field to 0 for relationships with a past end date.
  
  > A bit of history: Civi has always treated both past and disabled
  > relationships as "inactive" however there were inconsistencies in some
  > of the code (reports maybe) that were not doing so. I believe username_1
  > contributed the scheduled job to remedy this
  
  (From [a comment on issue CRM-18561](https://issues.civicrm.org/jira/browse/CRM-18561?focusedCommentId=89028&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-89028). See also [this forum post](https://forum.civicrm.org/index.php?topic=37176.0) for some discussion.)
  
  So it looks to me as though the scheduled job has failed in this case. If you view the job log for this job, are any errors shown? Or anything at the relevant time in the CiviCRM log file in files/civicrm/ConfigAndLog/ ?
  
  Could you test whether the problem occurs on the [4.6 demo site](http://d46.demo.civicrm.org/)?
  
  > **Comments:**
  > **username_0**: The demo sites have functioning Cron jobs?  
  > **username_2**: You can go to Administer -> System Settings -> Scheduled Jobs and click more -> Execute Now.  
  > **username_0**: False alarm. This works as expected on the demo site and I discovered it works correctly as well on our production site. It was apparently a glitch in this particular instance of the site on my local staging server. Thank you for helping out!  
  
  ---
  
  