- π§πͺBelgium hansrossel
Some changes for #13 to make it work in Drupal 10: Plugin folder should be capitalized, Url.php also with capitals and namespace is needed. See zip attached with the full module, just enable, rollback the failing migration and reimport.
namespace Drupal\custom_url_migrate\Plugin\migrate\field; use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate_drupal\Plugin\migrate\field\FieldPluginBase; /** * Defines a URL field migration plugin. * * @MigrateField( * id = "url", * core = {7}, * type_map = { * "url" = "link" * }, * source_module = "url", * destination_module = "link" * ) */ class Url extends FieldPluginBase { /** * {@inheritdoc} */ public function getFieldWidgetMap() { return [ 'url' => 'link', ]; } /** * {@inheritdoc} */ public function getFieldFormatterMap() { return [ 'default' => 'link', 'url' => 'link', 'url_external' => 'link', ]; } /** * {@inheritdoc} */ public function processFieldValues(MigrationInterface $migration, $field_name, $data) { $process = [ 'plugin' => 'sub_process', 'source' => $field_name, 'process' => [ 'uri' => 'value', 'title' => 'title', // Assuming that the URL field may have an optional title 'options' => 'options', // For any additional options that might be attached to the link ], ]; $migration->setProcessOfProperty($field_name, $process); } }