Answers.Body: <p>The <code>civicrm-disable-debug</code> command isn't defined in <code>civicrm_drush_command()</code>.  See line 155:</p>
  
  <pre><code>$items['civicrm-enable-debug'] = array(
    'description' =&gt; "Enable CiviCRM Debugging.",
  );
  </code></pre>
  
  <p>To solve this problem, you can add this below that:</p>
  
  <pre><code>$items['civicrm-disable-debug'] = array(
    'description' =&gt; "Disable CiviCRM Debugging.",
  );
  </code></pre>
  
  <p>This would be an easy item to submit as a pull request so everyone could benefit.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-06T11:09:15.940Z
Answers.Text: I just created an bugreport https://issues.civicrm.org/jira/browse/CRM-19976. Interesting is that this bug is a long time around (See https://issues.civicrm.org/jira/browse/CRM-12517).
Answers.UserDisplayName: Kainuk - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-06T11:21:00.693Z
Answers.Text: And a pull request https://github.com/civicrm/civicrm-drupal/pull/425
Answers.UserDisplayName: Kainuk - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-06T15:49:46.480Z
Answers.Text: Jon G and @Kainuk. Great thx for solution and follow up!
Answers.UserDisplayName: MarkDQ
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-06T04:16:34.923Z
Answers.LastActivityDate: 2017-02-06T04:16:34.923Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>The drush command <code>drush civicrm-disable-debug</code> returns error <code>The drush command 'civicrm-disable-debug' could not be found.  Run 'drush cache-clear drush' to clear the commandfile cache if you have installed new extensions.</code></p>
  
  <p>When entering <code>drush</code>to get the list of all commands, the disable command is not displayed, but the enable command is. The enable command works, and both are declared in the same way in ~/sites/all/modules/civicrm/drupal/drush/civicrm.drush.inc:</p>
  
  <pre><code>/**
   * Implementation of drush_hook_COMMAND_validate for command 'civicrm-enable-debug'
   */
  function drush_civicrm_enable_debug_validate() {
    return _civicrm_init();
  }
  
  function drush_civicrm_enable_debug() {
    $settings = array(
      'debug_enabled' =&gt; 1,
      'backtrace' =&gt; 1,
    );
  
    foreach ($settings as $key =&gt; $val) {
      $result = civicrm_api('Setting', 'create', array('version' =&gt; 3, $key =&gt; $val));
  
      if ($result['is_error']) {
        drush_log(dt('An error occurred: !message', array('!message' =&gt; $result['error_message'])), 'error');
        return;
      }
    }
  
    drush_log(dt('CiviCRM debug setting enabled.'), 'ok');
  }
  
  /**
   * Implementation of drush_hook_COMMAND_validate for command 'civicrm-disable-debug'
   */
  function drush_civicrm_disable_debug_validate() {
    return _civicrm_init();
  }
  
  function drush_civicrm_disable_debug() {
    $settings = array(
      'debug_enabled' =&gt; 0,
      'backtrace' =&gt; 0,
    );
  
    foreach ($settings as $key =&gt; $val) {
      $result = civicrm_api('Setting', 'create', array('version' =&gt; 3, $key =&gt; $val));
  
      if ($result['is_error']) {
        drush_log(dt('An error occurred: !message', array('!message' =&gt; $result['error_message'])), 'error');
        return;
      }
    }
  
    drush_log(dt('CiviCRM debug setting disabled.'), 'ok');
  }
  </code></pre>
  
  <p>What to do to "enable" the "disable" command? Meanwhile, i use phpmyadmin to change the value of the field "debug_enabled" in the table "civicrm_setting" to "i:0;" (without the ").</p>
  
  <p>Config: Drupal 7.53; CiviCRM 4.7.14</p>
  
Tags: <drupal><debugging><drush>
Title: Drush cannot disable civicrm debug
ThreadText: # Drush cannot disable civicrm debug
  
  (Asked by: username_0 on 2017-02-06)
  
  The drush command drush civicrm-disable-debug returns error The drush command 'civicrm-disable-debug' could not be found.  Run 'drush cache-clear drush' to clear the commandfile cache if you have installed new extensions.
  When entering drushto get the list of all commands, the disable command is not displayed, but the enable command is. The enable command works, and both are declared in the same way in ~/sites/all/modules/civicrm/drupal/drush/civicrm.drush.inc:
  /**
   * Implementation of drush_hook_COMMAND_validate for command 'civicrm-enable-debug'
   */
  function drush_civicrm_enable_debug_validate() {
    return _civicrm_init();
  }
  
  function drush_civicrm_enable_debug() {
    $settings = array(
      'debug_enabled' => 1,
      'backtrace' => 1,
    );
  
    foreach ($settings as $key => $val) {
      $result = civicrm_api('Setting', 'create', array('version' => 3, $key => $val));
  
      if ($result['is_error']) {
        drush_log(dt('An error occurred: !message', array('!message' => $result['error_message'])), 'error');
        return;
      }
    }
  
    drush_log(dt('CiviCRM debug setting enabled.'), 'ok');
  }
  
  /**
   * Implementation of drush_hook_COMMAND_validate for command 'civicrm-disable-debug'
   */
  function drush_civicrm_disable_debug_validate() {
    return _civicrm_init();
  }
  
  function drush_civicrm_disable_debug() {
    $settings = array(
      'debug_enabled' => 0,
      'backtrace' => 0,
    );
  
    foreach ($settings as $key => $val) {
      $result = civicrm_api('Setting', 'create', array('version' => 3, $key => $val));
  
      if ($result['is_error']) {
        drush_log(dt('An error occurred: !message', array('!message' => $result['error_message'])), 'error');
        return;
      }
    }
  
    drush_log(dt('CiviCRM debug setting disabled.'), 'ok');
  }
  
  What to do to "enable" the "disable" command? Meanwhile, i use phpmyadmin to change the value of the field "debug_enabled" in the table "civicrm_setting" to "i:0;" (without the ").
  Config: Drupal 7.53; CiviCRM 4.7.14
  
  **Tags:** drupal, debugging, drush
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-02-06. Score: 3 | Accepted answer
  
  The civicrm-disable-debug command isn't defined in civicrm_drush_command().  See line 155:
  $items['civicrm-enable-debug'] = array(
    'description' => "Enable CiviCRM Debugging.",
  );
  
  To solve this problem, you can add this below that:
  $items['civicrm-disable-debug'] = array(
    'description' => "Disable CiviCRM Debugging.",
  );
  
  This would be an easy item to submit as a pull request so everyone could benefit.
  
  > **Comments:**
  > **username_2**: I just created an bugreport https://issues.civicrm.org/jira/browse/CRM-19976. Interesting is that this bug is a long time around (See https://issues.civicrm.org/jira/browse/CRM-12517).  
  > **username_2**: And a pull request https://github.com/civicrm/civicrm-drupal/pull/425  
  > **username_0**: Jon G and @Kainuk. Great thx for solution and follow up!  
  
  ---
  
  