modules/tracker/tracker.install:129: update_variables_to_config('tracker.settings'

Thanks in advance for helping many hands to make light work!
See #2181257: [meta] Variables to config migration [d7] for instructions

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fastangel’s picture

Assigned: Unassigned » fastangel

working on this.

fastangel’s picture

Status: Active » Needs review

Tracker in D8 has cron_index_limit but in D6 doesn't have any variable. That should we do here?

chx’s picture

Title: Variable to config: tracker.settings » Variable to config: tracker.settings [D7 only]
Status: Needs review » Postponed

A quick grep verifies, yes, there is no variable_get in tracker.

One would wonder why are we going by the update_variables_to_config() calls, then? We do not have anything to better to go by and most variables didn't change.

eliza411’s picture

Project: IMP » Drupal core
Version: » 8.x-dev
Component: Code » migration system
Assigned: fastangel » Unassigned

Moving to the core queue to consolidate issues now that we're doing all the work there.

eliza411’s picture

Title: Variable to config: tracker.settings [D7 only] » Variable to config: tracker.settings [d7]
Status: Postponed » Active
eliza411’s picture

Issue summary: View changes
eliza411’s picture

Project: Drupal core » IMP
Version: 8.x-dev »
Component: migration system » Code
Parent issue: #2125745: [meta] Variables to config migration [D6] » #2181257: [meta] Variables to config migration [d7]
joshtaylor’s picture

Working on this.

joshtaylor’s picture

Assigned: Unassigned » joshtaylor
joshtaylor’s picture

FileSize
3.4 KB

First Drupal.org patch, after reading through the Patch Guide I believe this is the correct format.

One question I had, should I use:

+    ->values(array(
+      'name' => 'cron_index_limit',
+      'value' => serialize(1000),
+    ))

OR

+    ->values(array(
+      'name' => 'cron_index_limit',
+      'value' => 'i:1000;',
+    ))

To serialize? Looking at the D6 migration values they use option 2, looking at the D7 migration values they use serialize().

chx’s picture

It's really a mix of the two -- if youd dump with a script you get serialized data but we convert more complex data structures back to serialized arrays for the sake of readibility. So for a simple integer, just i: is fine.

benjy’s picture

Status: Active » Needs work
  1. +++ b/core/modules/migrate_drupal/config/migrate.migration.d7_tracker_settings.yml
    @@ -0,0 +1,10 @@
    +    plugin: drupal6_variable
    +    variables:
    

    Indentation needs to be 2 space.

  2. +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d7/MigrateTrackerConfigsTest.php
    @@ -0,0 +1,52 @@
    + * Contains \Drupal\migrate_drupal\Tests\d7\MigrateTrackerSettingsTest.
    

    This should be the same as the class name.

  3. +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d7/MigrateTrackerConfigsTest.php
    @@ -0,0 +1,52 @@
    +class MigrateTrackerConfigsTest extends MigrateDrupalTestBase {
    

    I think MigrateTrackerConfigTest reads better?

Above are just small doc changes, great job for your first patch.

Side note, It's strange that we're using d6_variable as our source? I know they're functionally equivalent but we should probably look at creating a base class with d6/7 sub classes.

joshtaylor’s picture

FileSize
3.39 KB

Thanks chx, I've changed the code not to use serialize.

benjy - thanks for the review.

If we want to change file from "MigrateTrackerConfigTest.php", the parent issue (https://drupal.org/node/2181257) will need to be updated to change point 4.

joshtaylor’s picture

FileSize
3.4 KB

Patch fixes variable indents and uses 'config' instead of d8_config

benjy’s picture

  1. +++ b/core/modules/migrate_drupal/config/migrate.migration.d7_tracker_settings.yml
    @@ -0,0 +1,10 @@
    \ No newline at end of file
    

    We need an empty line at the end of the file.

  2. +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d7/MigrateTrackerConfigTest.php
    @@ -0,0 +1,52 @@
    +    $executable = new MigrateExecutable($migration, new MigrateMessage());
    

    Replace new MigrateMessage() with $this because the migration implements MigrateMessageInterface

joshtaylor’s picture

FileSize
3.36 KB

Fixed newline and MigrateMessage

joshtaylor’s picture

Status: Needs work » Needs review
joshtaylor’s picture

ignore

benjy’s picture

Assigned: joshtaylor » Unassigned
Status: Needs review » Fixed

Committed to 8.x j9689f36

Status: Fixed » Closed (fixed)

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

jcost’s picture

Project: IMP » Drupal core
Version: » 8.0.x-dev
Component: Code » migration system
Status: Closed (fixed) » Needs work

Will need to be submitted again to Core since moving from sandbox.

phenaproxima’s picture

Needs to be merged into the parent issue.

phenaproxima’s picture

Status: Needs work » Closed (duplicate)

Duplicate of #2353777: Migrate Tracker module variables in D7. I'll give @joshtaylor credit in that issue.