Problem/Motivation

Once #2283977: Create a new ConfigEntity type for storing bundle-specific customizations of base fields is committed, the status, promote and sticky properties will be in their own config entity.

Proposed resolution

Write three new migrations for each field. We can simply re-use the existing NodeType source which provides everything we need.

Remaining tasks

Review patch.

User interface changes

n/a

API changes

n/a

Comments

benjy’s picture

Version: 8.x-dev » 8.0.x-dev
StatusFileSize
new88.79 KB

First patch attached introduces the new migrations and a test.

Because we're re-using the NodeType source, the options are still been saved against a node type because of:

  'settings/node/options': options

We need to refactor the NodeType source to save promote/status/sticky in the top level of the source row during prepareRow().

benjy’s picture

StatusFileSize
new7.95 KB

Just the migration stuff attached.

chx’s picture

Status: Postponed » Needs review

Let the bot pick up the patches...

chx’s picture

Status: Needs review » Postponed

and back to postponed.

The last submitted patch, 1: 2315167-1.patch, failed testing.

Status: Postponed » Needs work

The last submitted patch, 2: 2315167-2.patch, failed testing.

benjy’s picture

benjy’s picture

Status: Needs work » Needs review
chx’s picture

Status: Needs review » Reviewed & tested by the community

That looks good.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 7: 2315167-7.patch, failed testing.

benjy’s picture

Status: Needs work » Needs review
StatusFileSize
new8.61 KB
new2.46 KB

Fixed the tests.

Status: Needs review » Needs work

The last submitted patch, 11: 2315167-11.patch, failed testing.

benjy’s picture

Status: Needs work » Needs review
StatusFileSize
new8.63 KB
new931 bytes

Changed schema to use: migrate_entity_constant

penyaskito’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC if green. The schema change looks OK.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 13: 2315167-14.patch, failed testing.

benjy’s picture

Status: Needs work » Needs review
StatusFileSize
new8.91 KB
new586 bytes

Schema fix.

chx’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTypeTest.php
@@ -52,16 +47,6 @@ public function testNodeType() {
-        'revision' => FALSE,

@@ -71,15 +56,6 @@ public function testNodeType() {
-        'revision' => FALSE,

@@ -89,16 +65,6 @@ public function testNodeType() {
-        'revision' => TRUE,

We should still be testing the revision value.

benjy’s picture

Status: Needs work » Needs review
StatusFileSize
new9.14 KB
new2.79 KB

I've added revision back as well as the preview and submitted.

The most interesting change I made is:

-  'settings/node/options': options
+  'settings/node/options/revision': 'options/revision'

Because the new migrations share the same source I had to do this to stop the d6 settings getting promote/sticky as well.

chx’s picture

Status: Needs review » Reviewed & tested by the community

OK let's try this again.

alexpott’s picture

Status: Reviewed & tested by the community » Needs review
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTypeTest.php
@@ -91,14 +83,12 @@ public function testNodeType() {
-        'revision' => TRUE,
+        'revision' => FALSE,

This change surprises me - since we've not changed the test data. Also I think this means we are not testing that we've migrated a revision set to TRUE successfully either.

benjy’s picture

Assigned: benjy » Unassigned
StatusFileSize
new8.93 KB
new935 bytes

Good catch, a copy paste error in the test.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_type.yml
@@ -16,7 +16,7 @@ process:
-  'settings/node/options': options
+  'settings/node/options/revision': 'options/revision'
   create_body: has_body

chx ensured that this is the only option beside the other ones.

chx’s picture

What do I know. For me Drupal 6 is history I am slowly forgetting the nuances of. But look https://api.drupal.org/api/drupal/modules!node!content_types.inc/functio...

    '#options' => array(
      'status' => t('Published'),
      'promote' => t('Promoted to front page'),
      'sticky' => t('Sticky at top of lists'),
      'revision' => t('Create new revision'),
    ),

so... yeah.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTypeTest.php
@@ -78,8 +71,7 @@ public function testNodeType() {
-    // $this->assertEqual($node_type_story->settings['node'], $expected, 'Node type test_story settings correct.');
+    $this->assertEqual($node_type_page->settings['node'], $expected);

Same problem

benjy’s picture

Status: Needs work » Needs review
StatusFileSize
new8.93 KB
new725 bytes

Meh, i should have left this until after my holiday...

benjy’s picture

Back to RTBC anyone?

The test issues were just a simple copy and paste, the migration stuff should be simple enough to review.

berdir’s picture

Just a note: I'm changing those commented out assertions that are enabled again here in #2324121: NodeType's settings array was meant to be able to store information from mutliple modules. Will conflict in case that will get committed first.

ultimike’s picture

Berdir queued 26: 2315167-26.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 26: 2315167-26.patch, failed testing.

benjy’s picture

Status: Needs work » Needs review
StatusFileSize
new8.35 KB
chx’s picture

Status: Needs review » Reviewed & tested by the community

#23 was RTBC, one complaint raised, addressed since. Should be ready.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed d7840d6 and pushed to 8.0.x. Thanks!

  • alexpott committed d7840d6 on 8.0.x
    Issue #2315167 by benjy: Create migrations for status/promote/sticky.
    

Status: Fixed » Closed (fixed)

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