Support from Acquia helps fund testing for Drupal Acquia logo

Comments

naveenvalecha’s picture

Title: Convert Settings within upgrade » Migrate captcha settings
Priority: Major » Normal
Issue summary: View changes
ddrozdik’s picture

Status: Active » Fixed

This issue could be closed, since settings already converted to D8 format.

naveenvalecha’s picture

Title: Migrate captcha settings » Migrate captcha settings from d7 to d8
Issue summary: View changes
Status: Fixed » Active

Reusing this issue for the migrating d7 data to d8

ddrozdik’s picture

ok, current title is much better :)

heddn’s picture

couturier’s picture

This module is really suffering from a lack of time by maintainers to address even the big issues. Isn't it possible to hand-configure CAPTCHA in a new upgrade without too much work? Seems like our time should be spent at this point getting to a stable 8.x release since users are reporting the current 8.x dev is unusable in general and we are years past the Drupal 8 release.

Wim Leers’s picture

Issue tags: +migrate-d7-d8
Wim Leers’s picture

FYI, the recaptcha module, which depends on this one, does already have a migration ready: https://git.drupalcode.org/project/recaptcha/-/blob/8.x-3.x/migrations/d...

japerry’s picture

Status: Active » Needs review
FileSize
21.63 KB

Here is a first shot at migrating everything. still need to work through some specifics in the tests.

japerry’s picture

Lets try this again, should have 3 new migrations and tests to go alongside them.

Status: Needs review » Needs work

The last submitted patch, 10: 2036925-10.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

japerry’s picture

Status: Needs work » Needs review
FileSize
32.74 KB

  • japerry committed e8d540b on 8.x-1.x
    Issue #2036925 by japerry: d7 to D8/9 Migration Path
    
japerry’s picture

Status: Needs review » Fixed
heddn’s picture

Status: Fixed » Needs work

Sorry, I didn't jump in earlier to review. Some thoughts to consider:

+++ b/migrations/d7_captcha_sessions.yml
@@ -0,0 +1,35 @@
+  plugin: table

+++ b/src/Plugin/migrate/destination/Table.php
@@ -0,0 +1,309 @@
+ *   id = "table"

This is going to conflict w/ the destination provided by migrate_plus. Could we add a module name prefix to it? So we don't run into odd conflicts?

japerry’s picture

Status: Needs work » Needs review
FileSize
1.25 KB

Ohh good point it could. Here is a patch, if it passes tests then I'll commit it.

heddn’s picture

Status: Needs review » Reviewed & tested by the community

Much better. Thanks!

  • japerry committed 483dfcf on 8.x-1.x
    Issue #2036925 followup by japerry: Namespace the table module for...
japerry’s picture

Status: Reviewed & tested by the community » Fixed

Perfect! Fixed.

Wim Leers’s picture

Status: Fixed » Needs work
  1. +++ b/migrations/d7_captcha_points.yml
    @@ -0,0 +1,17 @@
    +migration_tags:
    +  - Drupal 7
    

    🐛 Missing Configuration tag.

  2. +++ b/migrations/d7_captcha_sessions.yml
    @@ -0,0 +1,35 @@
    +id: d7_captcha_sessions
    +label: 'Captcha Sessions Table'
    +migration_tags:
    +  - Drupal 7
    +source:
    +  plugin: d7_captcha_sessions
    +process:
    +  csid: csid
    +  token: token
    +  uid: uid
    +  sid: sid
    +  ip_address: ip_address
    +  timestamp: timestamp
    +  form_id: form_id
    +  solution: solution
    +  status: status
    +  attempts: attempts
    +destination:
    +  plugin: table
    +  table_name: captcha_sessions
    +  id_fields:
    

    🤔 Do we really need to migrate CAPTCHA sessions?

    Sessions won't get migrated from 7 to 9, so migrating CAPTCHA sessions seems completely pointless?

  3. +++ b/src/Plugin/migrate/destination/Table.php
    @@ -0,0 +1,309 @@
    +class Table extends DestinationBase implements ContainerFactoryPluginInterface, ImportAwareInterface {
    

    Then this could be removed too … 🤞

  4. +++ b/src/Plugin/migrate/source/CaptchaPoints.php
    @@ -0,0 +1,77 @@
    +  /**
    +   * The module handler.
    +   *
    +   * @var \Drupal\Core\Extension\ModuleHandlerInterface
    +   */
    +  protected $moduleHandler;
    

    🐛 Why inject this if it does not end up being used?

  5. +++ b/tests/src/Kernel/Migrate/d7/MigrateCaptchaPointsTest.php
    @@ -0,0 +1,90 @@
    +    $this->assertSame($form_id, $entity->label());
    

    🤔 Shouldn't this also

    $this->assertSame($form_id, $entity->getFormId());
    

    ?

    That is critical for CAPTCHA to work correctly, unlike the label.

japerry’s picture

Status: Needs work » Needs review
FileSize
18.65 KB

So CAPTCHA sessions are not the same as drupal user sessions, they're attached to the form that was submitted previously. While upgrading probably will remove any form cache, I suppose you cannot get the captcha session id anyway. So I guess it can be removed?

As for the other pieces, fixed. Here is a patch.

  • japerry committed 4ca4b0a on 8.x-1.x
    Issue #2036925 by japerry: Remove captcha sessions migration.
    
japerry’s picture

Status: Needs review » Fixed
Wim Leers’s picture

So I guess it can be removed?

That's my understanding, but hey, you are the CAPTCHA module maintainer 😊

As for the other pieces, fixed. Here is a patch.

Yay!

Status: Fixed » Closed (fixed)

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