A correct message will hopefully avoid people wasting their time. If the API is missing, the message should be displayed accordingly!

/**
 * When exporting via the API, make sure the user filled out the necessary info
 */
function _disqus_migrate_export_api_validate($form, &$form_state) {
  // Check for existance of Disqus API
  if (!file_exists('sites/all/libraries/disqusapi/disqusapi.php')) {
    form_set_error('', t('Your secret key must be entered before using this export functionality. Please get your application API keys from Disqus and enter them in the "Advanced" fieldset below. Also ensure that you have authenticated with Disqus.'));
  }
  
  // Make sure secret key is filled out
  $api_secret = variable_get('disqus_secretkey','');
  if (empty($api_secret)) {
    form_set_error('', t('Your secret key must be entered before using this export functionality. Please get your application API keys from Disqus and enter them in the "Advanced" fieldset on the settings page.'));
  }
}

Comments

dakku’s picture

Status: Active » Patch (to be ported)
StatusFileSize
new1.03 KB

patch

dakku’s picture

Any ideas if this Patch can be added?

slashrsm’s picture

Status: Patch (to be ported) » Fixed

Committed. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.