8 – Content moderation “current revision” not set on nodes migrated from Drupal 7 where there are both a published and draft revisions

I am working on upgrading a Drupal 7 site to Drupal 8. The upgrade uses a content-only custom migration. The Drupal 7 source site and the Drupal 8 destination do not contain any custom modules other than a Drupal 8 custom module containing the custom migration configuration. Both source and destination site were created using the Standard install profile.

I have created migrations for both the node and node revisions of the Page content type. The page node consists of a media reference field and a paragraph reference field. After running the migration I notice that for migrate nodes which had both a published and draft version in which the draft revision is more recent than the published revision then the current content revision is not set.

Here is the moderation tab of such a node in Drupal 7:

enter image description here

Here is the moderation tab of the same node after migrating it to Drupal 8:

enter image description here

Following is the content_moderation_state_revision table from the destination database. The node in question is id = 3.

enter image description here

Following is the content_moderation_state_field_revision table from the destination database.

enter image description here

Here is the config for the Page node migration:

langcode: en 

status: true 

dependencies: {  } 

id: health_node_standard_page 

label: Standard Page Nodes 

audit: true 

migration_tags: 

  - Drupal 7 

  - Content 

migration_group: health 

deriver: DrupalnodePluginmigrateD7NodeDeriver 

source: 

  plugin: d7_node_extended 

  node_type: page 

process: 

  nid: tnid 

  vid: vid 

  langcode: 

    - 

      plugin: static_map 

      source: language 

      map: 

        und: en 

      bypass: true 

  title: title 

  uid: node_uid 

  status: status 

  created: created 

  changed: changed 

  promote: promote 

  sticky: sticky 

  revision_uid: revision_uid 

  revision_log: log 

  revision_timestamp: timestamp 

  field_h_content_blocks: 

    plugin: sub_process 

    source: field_content_blocks 

    process: 

      paragraphs: 

        plugin: migration_lookup 

        migration: 

          - health_paragraph_content_text 

        source: value 

      target_id: 

        - 

          plugin: extract 

          source: '@paragraphs' 

          index: 

            - 0 

      target_revision_id: 

        - 

          plugin: extract 

          source: '@paragraphs' 

          index: 

            - 1 

  field_h_image_featured: 

    - 

      plugin: sub_process 

      source: field_featured_image 

      process: 

        target_id: 

          - 

            plugin: migration_lookup 

            migration: health_media_image 

            source: fid 

  moderation_state: 

    - 

      plugin: static_map 

      source: moderation_state 

      map: 

        published: published 

        draft: draft 

        needs_review: needs_review 

      default_value: draft 

destination: 

  plugin: entity:node 

  default_bundle: h_standard_page 

migration_dependencies: 

  required: 

    - health_user 

    - health_paragraph_content_text 

    - health_media_image 

Here is the config for the Page node revisions migration:

langcode: en 

status: true 

dependencies: {  } 

id: health_node_revision_standard_page 

label: Node revisions - Standard Page 

audit: true 

migration_tags: 

  - Drupal 7 

  - Content 

migration_group: health 

deriver: DrupalnodePluginmigrateD7NodeDeriver 

source: 

  plugin: d7_node_revision_extended 

process: 

  nid: 

    - 

      plugin: get 

      source: nid 

  vid: 

    - 

      plugin: get 

      source: vid 

  langcode: 

    - 

      plugin: static_map 

      source: language 

      map: 

        und: en 

      bypass: true 

  title: title 

  uid: node_uid 

  status: 

    - 

      plugin: get 

      source: status 

  created: created 

  changed: changed 

  promote: promote 

  sticky: sticky 

  revision_uid: revision_uid 

  revision_log: log 

  revision_timestamp: timestamp 

  moderation_state: 

    - 

      plugin: static_map 

      source: moderation_state 

      map: 

        published: published 

        draft: draft 

        needs_review: needs_review 

      default_value: draft 

destination: 

  plugin: entity_revision:node 

  default_bundle: h_standard_page 

migration_dependencies: 

  required: 

    - health_node_standard_page 

Both migrations make use of a custom “Source” which extends the “d7_node” and “d7_node_revision” source plugins accordingly. These extended source plugins get the moderation state info of the relevant node or node revision.

/**
 * Extended version of core Drupal 7 node source from database.
 *
 * @MigrateSource(
 *   id = "d7_node_extended",
 *   source_module = "node"
 * )
 */
class D7NodeExtended extends Node {

  /**
   * {@inheritdoc}
   */
  public function prepareRow(Row $row) {
    // Make the node's moderation state available to migration.
    $database = $this->getDatabase();
    $vid = $row->getSourceProperty('vid');
    $query = $database
      ->select('workbench_moderation_node_history', 'wm')
      ->fields('wm', ('state'))
      ->condition('wm.vid', $vid)
      ->orderBy('wm.stamp', 'DESC')
      ->range(0, 1);
    $value = $query
      ->execute()
      ->fetchField();
    if ($value) {
      $row->setSourceProperty('moderation_state', $value);
    }

    return parent::prepareRow($row);
  }
}
/**
 * Extended version of core Drupal 7 node source from database.
 *
 * @MigrateSource(
 *   id = "d7_node_revision_extended",
 *   source_module = "node"
 * )
 */
class D7NodeRevisionExtended extends NodeRevision {

  /**
   * {@inheritdoc}
   */
  public function prepareRow(Row $row) {
    // Make the node revision's moderation state available to migration.
    $database = $this->getDatabase();
    $vid = $row->getSourceProperty('vid');
    $query = $database
      ->select('workbench_moderation_node_history', 'wm')
      ->fields('wm', ('state'))
      ->condition('wm.vid', $vid)
      ->orderBy('wm.stamp', 'DESC')
      ->range(0, 1);
    $value = $query
      ->execute()
      ->fetchField();
    if ($value) {
      $row->setSourceProperty('moderation_state', $value);
    }

    return parent::prepareRow($row);
  }
}

Can’t log into my chrome book [migrated]

I can log into google on my PC and tablet BUT I can’t log in using my chromebook – I have the same password for all devices and the keyboard language is correct and wifi good.

SharePoint Migration Tool error “Errors or timeout for Server Processing the file: Not all the items in the package have been migrated”

I am migrating SharePoint 2013 site lists or libraries through SPMT(SharePoint Migration Tool)to SharePoint Online Modern site.While migrating it does not migrates anything with below error”Errors or timeout for Server Processing the file: Not all the items in the package have been migrated.”

It shows 0 bytes of 0 bytes migrated.

Kindly help me on this.

Thanks,
Kailash

Is undertaking on a bicycle frowned upon (UK)? [migrated]

Take the example where a bicycle lane in on the road, rather than the pavement. There is a queue of cars waiting at the lights, and the bike lane is clear right up to the lights. If you were to cycle right up to the lights, you would be undertaking all the queuing cars on the way. Is this an example of "dangerous driving", or otherwise frowned upon (UK)? What if the cars were moving? What if there wasn’t a bike lane, but you were staying to the side of the road so that other cars could overtake you if they wanted?

Can’t get SQL management studio to load [migrated]

Our wasptime software is having issues so I tried to open SQL server management studio express to try and figure this out but it just throws this message. I don’t even know where to find devenv.exe to open a command prompt there. Any ideas. I’m straight up stuck with a broken wasptime and not sure how to get it running….

][1]][1]

visual studio – Custom list definition solution migrated and not rendering the Sharepoint:Formfield controls

Good evening,

I have a NewForm.aspx and EditForm.aspx from a custom list defined by a WSP where the SharePoint:FormField controls stop to render after the page is loaded for the first time after deployed (not upgraded).

I already tried to change the assembly version of the Registers and even the SharePoint Product Version of the pacakge file from 14 to 19. But when I do that, SharePoint is not finding anymore the custom forms. It only finds if I keep the SharePoint Product Version to 14.

Does someone went through a situation similar to this too?

I can not open certain attachments beacuse of https//nam10.safelinks.ptotection.outlook.com. How do I get rid of the problem? [migrated]

I can not open certain attachments in my email because https//nam.safelinks.protection.outlook.com/? ……..pops up on screen. How do I get rid of it /

DMZ and ActiveDirectory users [migrated]

I start by saying that I am not really familiar with AD and DMZs.

In my company, we have a DMZ with one server, isolated from the internal network (only a few open ports) and exposed to the web. There are some IIS applications running which have access to the SQL Server.

I wanted to update the connectionstrings, remove userId and password, use Integrated Security = true and set a proper user to the application pool in order to remove the cleartext/hardcoded password from the web.configs.

The problem is that the server does not recognize the user, since the server is not part of the AD domain.

I’m quite sure there is a clean solution for such a scenario, but no clue.
What should I do?

Different name in visa and passport in us pr [migrated]

My father filed a request for us pr for me and now the issue it in visa file the name is reflecting as Rajeshkumar whereas my name is Rajesh bhai Patel. So can I show a proof by attaching affidavit stating both persons are of same name or what else I can do?

Thanks

migration – Migrate content with referenced taxonomy being migrated by term name

Is it possible to migrate content with term reference fields, but instead of referencing terms by their tid they are referenced by their term name?

instead of this:

field_tags:
  plugin: sub_process
  source: field_tags
  process:
    target_id: tid

Do something like this:

field_tags:
  plugin: sub_process
  source: field_tags
  process:
    target_id: [term name]