Comments

srishti.bankar created an issue. See original summary.

srishtiiee’s picture

StatusFileSize
new12.63 KB
srishtiiee’s picture

StatusFileSize
new12.63 KB
new484 bytes

Testing the patch on D8.

srishtiiee’s picture

Status: Needs work » Needs review
huzooka’s picture

Status: Needs review » Needs work
  1. +++ b/src/Plugin/migrate/process/MessageGlobalSettings.php
    @@ -0,0 +1,42 @@
    +class MessageGlobalSettings extends ProcessPluginBase {
    ...
    +    if ($value['message_purge_enable']) {
    ...
    +    return $value['purge_methods'];
    

    What happens if $value['message_purge_enable'] evaluates as FALSE?

    I think that there won't be any purge_methods then, so this will trigger an error.

  2. +++ b/src/Plugin/migrate/process/MessageTemplateSettings.php
    @@ -0,0 +1,45 @@
    +class MessageTemplateSettings extends ProcessPluginBase {
    ...
    +    $value['token options']['token replace'] = 1;
    

    Could you please add a comment about why this should be enabled?

  3. +++ b/src/Plugin/migrate/process/MessageTemplateSettings.php
    @@ -0,0 +1,45 @@
    +    if ($value['purge']['enabled']) {
    +      $value['purge_methods']['quota'] = [
    ...
    +    }
    +    unset($value['purge']);
    +    return $value;
    

    If purge isn't enabled, then purge_methods should be an empty array.

  4. +++ b/tests/src/Kernel/MessageGlobalSettingsMigrateTest.php
    @@ -0,0 +1,68 @@
    +class MessageGlobalSettingsMigrateTest extends MigrateDrupal7TestBase {
    

    It would be very nice if you have added some test data for message templates and actual messages as well.

  5. Preexisting issue: d7_message migration is missing the Content tag, and since message template is its bundle entity, it should depend on d7_message_template.
  6. Preexisting issue: d7_message_template migration is missing the Configuration tag.
srishtiiee’s picture

StatusFileSize
new46.23 KB
new52.47 KB

Addressed issues listed in #5.

srishtiiee’s picture

Status: Needs work » Needs review
StatusFileSize
new52.46 KB
new1.36 KB

Testing on D8.

Status: Needs review » Needs work

The last submitted patch, 7: message_migration_D8_test_3256423-7.patch, failed testing. View results

wim leers’s picture

All that (I think) was needed here, was for this patch to be tested in combination with #3256855-4: Duplicate message texts after migration..

wim leers’s picture

Status: Needs review » Needs work
Related issues: +#3259735: Add daily test against Drupal 9 core minor
  1. The test coverage looks great!
  2. +++ b/tests/src/Kernel/MessagesMigrateTest.php
    @@ -0,0 +1,69 @@
    + * @group node_class
    

    🐛 s/node_class/message/

  3. +++ b/tests/src/Kernel/MessagesMigrateTest.php
    @@ -0,0 +1,69 @@
    +    $this->assertEquals(2, count($result));
    

    Nit: This can use assertCount($2, result) instead to avoid the manual count() call 🤓

That second one is such a nitpick, that first one can easily be fixed by the maintainer on commit. So: marking this RTBC — awesome work here! D'oh, the tests are failing on 9.3! 😬

  1. 1) Drupal\Tests\message\Kernel\MessageGlobalSettingsMigrateTest::testMessageGlobalSettingsMigration
    Failed asserting that two arrays are identical.
    

    I bet this is due to https://www.drupal.org/node/3230199 — i.e. all you need is to re-sort these, if my suspicions is correct.

  2. 1) Drupal\Tests\message\Kernel\MessageTemplateMigrateTest::testMessageTemplateMigration
    Failed asserting that two arrays are identical.

    Same suspicion.

  3. All other test failures are out-of-scope here and are pre-existing bugs in the module! See #3259735: Add daily test against Drupal 9 core minor.
srishtiiee’s picture

Status: Needs work » Needs review
StatusFileSize
new56.48 KB
new2.95 KB
srishtiiee’s picture

Renamed the patch.

wim leers’s picture

Status: Needs review » Reviewed & tested by the community

The 8 failures in #12 (see https://www.drupal.org/pift-ci-job/2302552) are identical to those in #3259735-2: Add daily test against Drupal 9 core minor (see https://www.drupal.org/pift-ci-job/2300844). I manually compared those test results.

That means this is de facto green!

srishtiiee’s picture

StatusFileSize
new52.42 KB

Final patch to avoid conflicts with Issue #3256855 patch #4.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 14: message_migration_3256423-14.patch, failed testing. View results

jhedstrom’s picture

Tests are now passing on the main branch, so it looks like this needs a bit of work to get the new tests passing.