Hi,
Are there any plans to introduce D8 version of this module?
I would like to help you with development of this version or to implement it from scratch.

Comments

shkiper’s picture

Status: Active » Needs review
StatusFileSize
new13.28 KB

I've made this module compatible with Drupal 8 stable version. Here is my patch

naveenvalecha’s picture

Status: Needs review » Needs work
  1. +++ b/keycaptcha.module
    @@ -38,15 +38,17 @@ if ( !class_exists('KeyCAPTCHA_CLASS') ) {
    +		      $kc_var_time = preg_split('/\/| |:/', $kc_vars[2]);
    

    extra tabs here.

  2. +++ b/src/Form/KeycaptchaAdminSettings.php
    @@ -0,0 +1,73 @@
    +/**
    + * @file
    + * Contains \Drupal\keycaptcha\Form\KeycaptchaAdminSettings.
    + */
    

    Remove it. its not needed.

  3. +++ b/src/Form/KeycaptchaAdminSettings.php
    @@ -0,0 +1,73 @@
    +/**
    

    Add a new line after use statements. i.e. b/c use statements and description.

  4. +++ b/src/Form/KeycaptchaAdminSettings.php
    @@ -0,0 +1,73 @@
    + * Configuration form.
    

    This is better "Keycaptcha Configuration form"

  5. +++ b/src/Form/KeycaptchaAdminSettings.php
    @@ -0,0 +1,73 @@
    +      '#default_value' => \Drupal::config('keycaptcha.settings')->get('keycaptcha_private_key'),
    

    use $this->config here instead of static functions.

  6. +++ b/src/Form/KeycaptchaAdminSettings.php
    @@ -0,0 +1,73 @@
    +      '#title' => t('KeyCAPTCHA code'),
    

    use inejctable t here i.e. $this->t

  7. +++ b/src/Form/KeycaptchaAdminSettings.php
    @@ -0,0 +1,73 @@
    +      '#default_value' => \Drupal::config('keycaptcha.settings')->get('keycaptcha_js_code'),
    

    same as above. use $this->config

naveenvalecha’s picture

@mvladykin,
Any plans to release the d8 development snapshot ?

shkiper’s picture

Status: Needs work » Needs review
StatusFileSize
new13.26 KB

Hi @naveenvalecha. Thank you for your review. I fixed issues 1-7. Here is my new patch

naveenvalecha’s picture

Status: Needs review » Needs work
  1. +++ b/keycaptcha.routing.yml
    @@ -0,0 +1,7 @@
    +    _permission: 'administer CAPTCHA settings'
    

    Define these permissions in .permissions.yml file
    Also change all the workds in the permission key to lowercase.

  2. +++ b/src/Form/KeycaptchaAdminSettings.php
    @@ -0,0 +1,71 @@
    +    if (method_exists($this, '_submitForm')) {
    +      $this->_submitForm($form, $form_state);
    +    }
    

    What this is for ?

  3. +++ b/src/Form/KeycaptchaAdminSettings.php
    @@ -0,0 +1,71 @@
    +      '#default_value' => $settings['keycaptcha_private_key'],
    

    user $config->get directly here.

I'll test it thoroughly sometime later.

shkiper’s picture

Status: Needs work » Needs review
StatusFileSize
new13.13 KB

Hi @naveenvalecha.
1. This is permissions from CAPTCHA module.
2. Copy/paste mistake, deleted.
3. Done