Making a timezone field migrate process plugin

Created on 25 May 2023, over 1 year ago
Updated 6 June 2023, over 1 year ago

Problem/Motivation

We have an API that has timezone information that we migrate into our site daily. I recently added the tzfield module to our site and the Timezone field to a content type for the purposed of importing that timezone information. I was going to add a patch to the module for importing data, but it's not working.

I am having a hard time getting this to even be recognized and continue to receive

`Plugin (tzfield) instance class "Drupal\tzfield\Plugin\migrate\process\TzField" does not exist. `

Steps to reproduce

Add a 'TzField.php' file
under Plugin\migrate\process
with the following

<?php

namespace Drupal\tzfield\Plugin\migrate\process;

use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\Row;

/**
 * Process the D6 Timezone offset into a D8 compatible timezone name.
 *
 * @MigrateProcessPlugin(
 *   id = "tzfield"
 * )
 */
class TsField extends ProcessPluginBase {

  /**
   * {@inheritdoc}
   */
  public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
    $timezone_name = '';
    // TODO: Add logic

    return $timezone_name;
  }

}

Run a migration with an update flag
Receive the error that the Plugin instance class does not exist.

Proposed resolution

If known, suggest a means for getting the plugin to be found.

πŸ’¬ Support request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States skyriter

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024