Commit 52abb960 authored by tonnosf's avatar tonnosf Committed by vladan.me

Settings rename: captcha_default_challenge --> default_challenge

parent 93bb1b68
......@@ -210,7 +210,7 @@ function _captcha_parse_captcha_type($captcha_type) {
return array(NULL, NULL);
}
if ($captcha_type == 'default') {
$captcha_type = \Drupal::config('captcha.settings')->get('captcha_default_challenge', 'captcha/Math');
$captcha_type = \Drupal::config('captcha.settings')->get('default_challenge', 'captcha/Math');
}
return explode('/', $captcha_type);
}
......
captcha_default_challenge: 'captcha/Math'
default_challenge: 'captcha/Math'
captcha_description: 'This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.'
captcha_administration_mode: 0
captcha_allow_on_admin_pages: 0
......
......@@ -5,11 +5,11 @@ captcha.settings:
type: mapping
label: 'External Links Settings'
mapping:
captcha_default_challenge:
default_challenge:
type: string
label: 'The default challenge for captcha.'
captcha_description:
type: string
type: label
label: 'The default captcha description.'
captcha_administration_mode:
type: boolean
......
......@@ -88,7 +88,7 @@ class CaptchaPoint extends ConfigEntityBase implements CaptchaPointInterface {
}
else {
// @Todo inject config via DI.
return \Drupal::config('captcha.settings')->get('captcha_default_challenge');
return \Drupal::config('captcha.settings')->get('default_challenge');
}
}
......
......@@ -44,7 +44,7 @@ class CaptchaPointForm extends EntityForm {
'#type' => 'select',
'#title' => t('Challenge type'),
'#description' => t('The CAPTCHA type to use for this form.'),
'#default_value' => ($captcha_point->getCaptchaType() ?: $this->config('captcha.settings')->get('captcha_default_challenge')),
'#default_value' => ($captcha_point->getCaptchaType() ?: $this->config('captcha.settings')->get('default_challenge')),
'#options' => _captcha_available_challenge_types(),
);
......
......@@ -199,7 +199,7 @@ class CaptchaSettingsForm extends ConfigFormBase {
$config = \Drupal::config('captcha.settings');
$config->set('captcha_administration_mode', $form_state['values']['captcha_administration_mode']);
$config->set('captcha_allow_on_admin_pages', $form_state['values']['captcha_allow_on_admin_pages']);
$config->set('captcha_default_challenge', $form_state['values']['captcha_default_challenge']);
$config->set('default_challenge', $form_state['values']['captcha_default_challenge']);
// CAPTCHA description stuff.
$config->set('captcha_add_captcha_description', $form_state['values']['captcha_add_captcha_description']);
......
......@@ -62,7 +62,7 @@ class CaptchaAdminTestCase extends CaptchaBaseWebTestCase {
// Set to 'default'
captcha_set_form_id_setting($comment_form_id, 'default');
\Drupal::config('captcha.settings')->set('captcha_default_challenge', 'foo/bar')->save();
\Drupal::config('captcha.settings')->set('default_challenge', 'foo/bar')->save();
$result = captcha_get_form_id_setting($comment_form_id);
$this->assertNotNull($result, 'Setting and getting CAPTCHA point: default', 'CAPTCHA');
// $this->assertEqual($result->module, 'foo', 'Setting and getting
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment