Commit 49ac4014 authored by Reena Raghavan's avatar Reena Raghavan

Broadcast to Stories

parent 074145e9
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "f915fc2404f78a22a5876e043cd3c20e", "content-hash": "7bc9948d92ced228c448856610d3c41e",
"packages": [ "packages": [
{ {
"name": "asm89/stack-cors", "name": "asm89/stack-cors",
...@@ -1100,6 +1100,507 @@ ...@@ -1100,6 +1100,507 @@
}, },
"time": "2022-07-02T10:48:51+00:00" "time": "2022-07-02T10:48:51+00:00"
}, },
{
"name": "doctrine/cache",
"version": "1.13.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/cache.git",
"reference": "56cd022adb5514472cb144c087393c1821911d09"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/cache/zipball/56cd022adb5514472cb144c087393c1821911d09",
"reference": "56cd022adb5514472cb144c087393c1821911d09",
"shasum": ""
},
"require": {
"php": "~7.1 || ^8.0"
},
"conflict": {
"doctrine/common": ">2.2,<2.4"
},
"require-dev": {
"alcaeus/mongo-php-adapter": "^1.1",
"cache/integration-tests": "dev-master",
"doctrine/coding-standard": "^9",
"mongodb/mongodb": "^1.1",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"predis/predis": "~1.0",
"psr/cache": "^1.0 || ^2.0 || ^3.0",
"symfony/cache": "^4.4 || ^5.4 || ^6",
"symfony/var-exporter": "^4.4 || ^5.4 || ^6"
},
"suggest": {
"alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.",
"homepage": "https://www.doctrine-project.org/projects/cache.html",
"keywords": [
"abstraction",
"apcu",
"cache",
"caching",
"couchdb",
"memcached",
"php",
"redis",
"xcache"
],
"support": {
"issues": "https://github.com/doctrine/cache/issues",
"source": "https://github.com/doctrine/cache/tree/1.13.0"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache",
"type": "tidelift"
}
],
"time": "2022-05-20T20:06:54+00:00"
},
{
"name": "doctrine/collections",
"version": "1.8.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/collections.git",
"reference": "2b44dd4cbca8b5744327de78bafef5945c7e7b5e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/collections/zipball/2b44dd4cbca8b5744327de78bafef5945c7e7b5e",
"reference": "2b44dd4cbca8b5744327de78bafef5945c7e7b5e",
"shasum": ""
},
"require": {
"doctrine/deprecations": "^0.5.3 || ^1",
"php": "^7.1.3 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^9.0 || ^10.0",
"phpstan/phpstan": "^1.4.8",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.1.5",
"vimeo/psalm": "^4.22"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Common\\Collections\\": "lib/Doctrine/Common/Collections"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.",
"homepage": "https://www.doctrine-project.org/projects/collections.html",
"keywords": [
"array",
"collections",
"iterators",
"php"
],
"support": {
"issues": "https://github.com/doctrine/collections/issues",
"source": "https://github.com/doctrine/collections/tree/1.8.0"
},
"time": "2022-09-01T20:12:10+00:00"
},
{
"name": "doctrine/common",
"version": "2.13.3",
"source": {
"type": "git",
"url": "https://github.com/doctrine/common.git",
"reference": "f3812c026e557892c34ef37f6ab808a6b567da7f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/common/zipball/f3812c026e557892c34ef37f6ab808a6b567da7f",
"reference": "f3812c026e557892c34ef37f6ab808a6b567da7f",
"shasum": ""
},
"require": {
"doctrine/annotations": "^1.0",
"doctrine/cache": "^1.0",
"doctrine/collections": "^1.0",
"doctrine/event-manager": "^1.0",
"doctrine/inflector": "^1.0",
"doctrine/lexer": "^1.0",
"doctrine/persistence": "^1.3.3",
"doctrine/reflection": "^1.0",
"php": "^7.1 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^1.0",
"phpstan/phpstan": "^0.11",
"phpstan/phpstan-phpunit": "^0.11",
"phpunit/phpunit": "^7.0",
"squizlabs/php_codesniffer": "^3.0",
"symfony/phpunit-bridge": "^4.0.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.11.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Common\\": "lib/Doctrine/Common"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
},
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com"
}
],
"description": "PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects depend on such as better reflection support, persistence interfaces, proxies, event system and much more.",
"homepage": "https://www.doctrine-project.org/projects/common.html",
"keywords": [
"common",
"doctrine",
"php"
],
"support": {
"issues": "https://github.com/doctrine/common/issues",
"source": "https://github.com/doctrine/common/tree/2.13.x"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcommon",
"type": "tidelift"
}
],
"time": "2020-06-05T16:46:05+00:00"
},
{
"name": "doctrine/deprecations",
"version": "v1.0.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/deprecations.git",
"reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de",
"reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de",
"shasum": ""
},
"require": {
"php": "^7.1|^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^9",
"phpunit/phpunit": "^7.5|^8.5|^9.5",
"psr/log": "^1|^2|^3"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.",
"homepage": "https://www.doctrine-project.org/",
"support": {
"issues": "https://github.com/doctrine/deprecations/issues",
"source": "https://github.com/doctrine/deprecations/tree/v1.0.0"
},
"time": "2022-05-02T15:47:09+00:00"
},
{
"name": "doctrine/event-manager",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/event-manager.git",
"reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/event-manager/zipball/95aa4cb529f1e96576f3fda9f5705ada4056a520",
"reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520",
"shasum": ""
},
"require": {
"doctrine/deprecations": "^0.5.3 || ^1",
"php": "^7.1 || ^8.0"
},
"conflict": {
"doctrine/common": "<2.9"
},
"require-dev": {
"doctrine/coding-standard": "^9 || ^10",
"phpstan/phpstan": "~1.4.10 || ^1.8.8",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"vimeo/psalm": "^4.24"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Common\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
},
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com"
}
],
"description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.",
"homepage": "https://www.doctrine-project.org/projects/event-manager.html",
"keywords": [
"event",
"event dispatcher",
"event manager",
"event system",
"events"
],
"support": {
"issues": "https://github.com/doctrine/event-manager/issues",
"source": "https://github.com/doctrine/event-manager/tree/1.2.0"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager",
"type": "tidelift"
}
],
"time": "2022-10-12T20:51:15+00:00"
},
{
"name": "doctrine/inflector",
"version": "1.4.4",
"source": {
"type": "git",
"url": "https://github.com/doctrine/inflector.git",
"reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/inflector/zipball/4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9",
"reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^8.0",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-phpunit": "^0.12",
"phpstan/phpstan-strict-rules": "^0.12",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Inflector\\": "lib/Doctrine/Inflector",
"Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.",
"homepage": "https://www.doctrine-project.org/projects/inflector.html",
"keywords": [
"inflection",
"inflector",
"lowercase",
"manipulation",
"php",
"plural",
"singular",
"strings",
"uppercase",
"words"
],
"support": {
"issues": "https://github.com/doctrine/inflector/issues",
"source": "https://github.com/doctrine/inflector/tree/1.4.4"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector",
"type": "tidelift"
}
],
"time": "2021-04-16T17:34:40+00:00"
},
{ {
"name": "doctrine/lexer", "name": "doctrine/lexer",
"version": "1.2.3", "version": "1.2.3",
...@@ -1176,6 +1677,108 @@ ...@@ -1176,6 +1677,108 @@
], ],
"time": "2022-02-28T11:07:21+00:00" "time": "2022-02-28T11:07:21+00:00"
}, },
{
"name": "doctrine/persistence",
"version": "1.3.8",
"source": {
"type": "git",
"url": "https://github.com/doctrine/persistence.git",
"reference": "7a6eac9fb6f61bba91328f15aa7547f4806ca288"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/persistence/zipball/7a6eac9fb6f61bba91328f15aa7547f4806ca288",
"reference": "7a6eac9fb6f61bba91328f15aa7547f4806ca288",
"shasum": ""
},
"require": {
"doctrine/annotations": "^1.0",
"doctrine/cache": "^1.0",
"doctrine/collections": "^1.0",
"doctrine/event-manager": "^1.0",
"doctrine/reflection": "^1.2",
"php": "^7.1 || ^8.0"
},
"conflict": {
"doctrine/common": "<2.10@dev"
},
"require-dev": {
"doctrine/coding-standard": "^6.0",
"phpstan/phpstan": "^0.11",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"vimeo/psalm": "^3.11"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Common\\": "lib/Doctrine/Common",
"Doctrine\\Persistence\\": "lib/Doctrine/Persistence"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
},
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com"
}
],
"description": "The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.",
"homepage": "https://doctrine-project.org/projects/persistence.html",
"keywords": [
"mapper",
"object",
"odm",
"orm",
"persistence"
],
"support": {
"issues": "https://github.com/doctrine/persistence/issues",
"source": "https://github.com/doctrine/persistence/tree/1.3.x"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fpersistence",
"type": "tidelift"
}
],
"time": "2020-06-20T12:56:16+00:00"
},
{ {
"name": "doctrine/reflection", "name": "doctrine/reflection",
"version": "1.2.3", "version": "1.2.3",
...@@ -1722,6 +2325,72 @@ ...@@ -1722,6 +2325,72 @@
"source": "https://git.drupalcode.org/project/custom_sql_migrate_source_plugin" "source": "https://git.drupalcode.org/project/custom_sql_migrate_source_plugin"
} }
}, },
{
"name": "drupal/devel",
"version": "5.0.2",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/devel.git",
"reference": "5.0.2"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/devel-5.0.2.zip",
"reference": "5.0.2",
"shasum": "9299d52d806897240fb5a57e66f12e09c4f00960"
},
"require": {
"doctrine/common": "^2.7",
"drupal/core": "^9 || ^10",
"symfony/var-dumper": "^4 || ^5 || ^6"
},
"conflict": {
"kint-php/kint": "<3"
},
"require-dev": {
"drush/drush": "^11"
},
"suggest": {
"kint-php/kint": "Kint provides an informative display of arrays/objects. Useful for debugging and developing."
},
"type": "drupal-module",
"extra": {
"drupal": {
"version": "5.0.2",
"datestamp": "1664317512",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
}
},
"drush": {
"services": {
"drush.services.yml": "^9 || ^10 || ^11"
}
}
},
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0-or-later"
],
"authors": [
{
"name": "drupalspoons",
"homepage": "https://www.drupal.org/user/3647684"
},
{
"name": "moshe weitzman",
"homepage": "https://www.drupal.org/user/23"
}
],
"description": "Various blocks, pages, and functions for developers.",
"homepage": "https://www.drupal.org/project/devel",
"support": {
"source": "https://gitlab.com/drupalspoons/devel",
"issues": "https://gitlab.com/drupalspoons/devel/-/issues",
"slack": "https://drupal.slack.com/archives/C012WAW1MH6"
}
},
{ {
"name": "drupal/entity_reference_revisions", "name": "drupal/entity_reference_revisions",
"version": "1.10.0", "version": "1.10.0",
......
id: article id: article
label: Migrate Article label: Migrate Article
migration_group: my_custom_migrate migration_group: database
source_type: Database source_type: Database
source: source:
......
id: author_simple_portfolio_csv_import
label: Import Author Simple Portfolio
migration_tags:
- CSV
migration_group: my_custom_migrate
source:
plugin: 'csv'
path: public://import-sources/portfolio_csv.csv
delimiter: ','
enclosure: '"'
header_offset: 0
ids:
- nid
process:
field_name_and_surname: field_name_and_surname
field_social_media_url: field_social_media_url
destination:
plugin: entity_reference_revisions:paragraph
default_bundle: author_with_url
migration_dependencies:
required: {}
optional: {}
\ No newline at end of file
id: broadcast_csv_import
label: Import Broadcast
migration_tags:
- CSV
migration_group: broadcast
source:
plugin: csv
path: public://import-sources/broadcast_list.csv
constants:
file_destination: 'public://images'
ids:
[nid]
delimiter: ','
enclosure: '"'
header_row_count: 2
keys:
- nid
process:
nid: nid
title: title
# type: type
status: status
field_broadcast_type :
-
plugin: skip_on_empty
method: row
source: field_broadcast_type
message: 'Field field_broadcast_type is missing'
field_country:
-
plugin: skip_on_empty
method: row
source: field_country
message: 'Field field_country is missing'
field_founding_amount: field_founding_amount
field_founding_status:
-
plugin: skip_on_empty
method: row
source: field_founding_status
message: 'Field field_founding_status is missing'
field_founding_year: field_founding_year
field_github_legend: field_github_legend
field_github_url: field_github_url
field_graduated: field_graduated
field_organization:
-
plugin: skip_on_empty
method: row
source: field_organization
message: 'Field field_organization is missing'
field_theme:
-
plugin: skip_on_empty
method: row
source: field_theme
message: 'Field field_theme is missing'
# field_thumbnail/target_id:
# -
# plugin: migration_lookup
# migration: broadcast_thumbnail_media_csv_import
# source: mid
# no_stub: true
destination:
plugin: entity:node
default_bundle: stories
overwrite_properties:
- title
\ No newline at end of file
id: broadcast_thumbnail_file_csv_import
label: Import Broadcast Thumbnail File
migration_tags:
- CSV
migration_group: broadcast
source:
constants:
file_source_uri: https://venturefund.lndo.site
file_dest_uri: public://images
plugin: csv
path: public://import-sources/broadcast_list.csv
ids:
[nid]
delimiter: ','
enclosure: '"'
track_changes: true
header_row_count: 2
keys:
- mid
process:
fid: mid
uid:
-
plugin: default_value
default_value: 1
filename: field_thumbnail_name
file_source:
-
plugin: concat
delimiter: /
source:
- constants/file_source_uri
- field_thumbnail
# -
# plugin: urlencode
file_dest:
-
plugin: concat
delimiter: /
source:
- constants/file_dest_uri
- field_thumbnail_name
# -
# plugin: urlencode
uri:
-
plugin: file_copy
source:
- '@file_source'
- '@file_dest'
file_exists: use existing
destination:
plugin: 'entity:file'
migration_dependencies:
required: { }
optional: { }
\ No newline at end of file
id: broadcast_thumbnail_media_csv_import
label: Import Broadcast Thumbnail Media
migration_tags:
- CSV
migration_group: broadcast
source:
plugin: csv
path: public://import-sources/broadcast_list.csv
ids:
[nid]
delimiter: ','
enclosure: '"'
header_row_count: 2
keys:
- mid
process:
mid: mid
name: field_thumbnail_name
bundle:
-
plugin: default_value
default_value: image
uid:
-
plugin: default_value
default_value: 1
# field_media_image:
# -
# plugin: migration_lookup
# migration: broadcast_thumbnail_file_csv_import
# source: mid
# -
# plugin: skip_on_empty
# method: process
# field_media_image/alt: field_thumbnail_name
# field_media_image/title: field_thumbnail_name
destination:
plugin: 'entity:media'
overwrite_properties:
- field_media_image/target_id
migration_dependencies:
required: { }
optional: { }
\ No newline at end of file
id: custom_taxonomy_term id: custom_taxonomy_term
label: Migrate taxonomy terms label: Migrate taxonomy terms
migration_group: my_custom_migrate migration_group: database
source_type: Database source_type: Database
source: source:
......
id: files id: files
label: Migrate Files label: Migrate Files
migration_group: my_custom_migrate migration_group: database
source_type: Database source_type: Database
source: source:
......
...@@ -35,7 +35,7 @@ process: ...@@ -35,7 +35,7 @@ process:
method: row method: row
source: field_apply_type source: field_apply_type
message: 'Field field_apply_type is missing' message: 'Field field_apply_type is missing'
# field_author_simple: field_author_simple field_author_simple: field_author_simple
# field_background_foto: field_background_foto # field_background_foto: field_background_foto
field_broadcast_article_ref: field_broadcast_article_ref field_broadcast_article_ref: field_broadcast_article_ref
# field_content: field_content # field_content: field_content
......
...@@ -2,7 +2,7 @@ id: taxonomy_term_apply_type_csv_import ...@@ -2,7 +2,7 @@ id: taxonomy_term_apply_type_csv_import
label: Import Taxonomy Term label: Import Taxonomy Term
migration_tags: migration_tags:
- CSV - CSV
migration_group: my_custom_migrate migration_group: taxonomy
source: source:
plugin: csv plugin: csv
......
...@@ -2,7 +2,7 @@ id: taxonomy_term_broadcast_types_csv_import ...@@ -2,7 +2,7 @@ id: taxonomy_term_broadcast_types_csv_import
label: Import Taxonomy Term label: Import Taxonomy Term
migration_tags: migration_tags:
- CSV - CSV
migration_group: my_custom_migrate migration_group: taxonomy
source: source:
plugin: csv plugin: csv
......
...@@ -2,7 +2,7 @@ id: taxonomy_term_countries_csv_import ...@@ -2,7 +2,7 @@ id: taxonomy_term_countries_csv_import
label: Import Taxonomy Term label: Import Taxonomy Term
migration_tags: migration_tags:
- CSV - CSV
migration_group: my_custom_migrate migration_group: taxonomy
source: source:
plugin: csv plugin: csv
......
...@@ -2,7 +2,7 @@ id: taxonomy_term_founding_status_csv_import ...@@ -2,7 +2,7 @@ id: taxonomy_term_founding_status_csv_import
label: Import Taxonomy Term label: Import Taxonomy Term
migration_tags: migration_tags:
- CSV - CSV
migration_group: my_custom_migrate migration_group: taxonomy
source: source:
plugin: csv plugin: csv
......
...@@ -2,7 +2,7 @@ id: taxonomy_term_media_csv_import ...@@ -2,7 +2,7 @@ id: taxonomy_term_media_csv_import
label: Import Taxonomy Term label: Import Taxonomy Term
migration_tags: migration_tags:
- CSV - CSV
migration_group: my_custom_migrate migration_group: taxonomy
source: source:
plugin: csv plugin: csv
......
...@@ -2,7 +2,7 @@ id: taxonomy_term_organizations_csv_import ...@@ -2,7 +2,7 @@ id: taxonomy_term_organizations_csv_import
label: Import Taxonomy Term label: Import Taxonomy Term
migration_tags: migration_tags:
- CSV - CSV
migration_group: my_custom_migrate migration_group: taxonomy
source: source:
plugin: csv plugin: csv
......
...@@ -2,7 +2,7 @@ id: taxonomy_term_tags_csv_import ...@@ -2,7 +2,7 @@ id: taxonomy_term_tags_csv_import
label: Import Taxonomy Term label: Import Taxonomy Term
migration_tags: migration_tags:
- CSV - CSV
migration_group: my_custom_migrate migration_group: taxonomy
source: source:
plugin: csv plugin: csv
......
...@@ -2,7 +2,7 @@ id: taxonomy_term_team_member_csv_import ...@@ -2,7 +2,7 @@ id: taxonomy_term_team_member_csv_import
label: Import Taxonomy Term label: Import Taxonomy Term
migration_tags: migration_tags:
- CSV - CSV
migration_group: my_custom_migrate migration_group: taxonomy
source: source:
plugin: csv plugin: csv
......
...@@ -2,7 +2,7 @@ id: taxonomy_term_themes_csv_import ...@@ -2,7 +2,7 @@ id: taxonomy_term_themes_csv_import
label: Import Taxonomy Term label: Import Taxonomy Term
migration_tags: migration_tags:
- CSV - CSV
migration_group: my_custom_migrate migration_group: taxonomy
source: source:
plugin: csv plugin: csv
......
id: users id: users
label: Migrate Users label: Migrate Users
migration_group: my_custom_migrate migration_group: database
source_type: Database source_type: Database
source: source:
......
<?php
namespace Drupal\uvf_migrate\Controller;
use Drupal\Core\Controller\ControllerBase;
/**
* Returns responses for UVF Migrate Module routes.
*/
class UvfMigrateController extends ControllerBase
{
/**
* Builds the response.
*/
public function build()
{
$data = \Drupal::service('uvf_migrate.importcsv')->getData();
$csv = \Drupal::service('uvf_migrate.importcsv')->importData();
$build['content'] = [
'#type' => 'item',
'#markup' => $this->t('It works!'.$data),
];
return $build;
}
}
<?php
namespace Drupal\uvf_migrate;
use Drupal\Core\Session\AccountInterface;
use Drupal\node\Entity\Node;
use Drupal\media\Entity\Media;
use Drupal\file\Entity\File;
/**
* Service description.
*/
class Importcsv
{
protected $currentUser;
/**
* CustomService constructor.
* @param AccountInterface $currentUser
*/
public function __construct(AccountInterface $currentUser)
{
$this->currentUser = $currentUser;
}
/**
* @return \Drupal\Component\Render\MarkupInterface|string
*/
public function getData()
{
return $this->currentUser->getDisplayName();
}
/**
* Import Data.
*/
public function importData()
{
/**
* Import data from a CSV file.
*
* @param $script
* Path to the CSV file.
*/
$dataFile = fopen('public://import-sources/broadcast_list.csv', 'r');
// Read the document header,
// this row shouldn't be processed.
while (($line = fgetcsv($dataFile)) !== false) {
//$line is an array of the csv elements
if ($line[0] != 'nid') {
$nid = $line[0];
$node_storage = \Drupal::entityTypeManager()->getStorage(
'node'
);
$node = $node_storage->load($nid);
//echo $node->title->value; // "Lorem Ipsum..."
$author_simple = $line[17];
preg_match_all(
'#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#',
$author_simple,
$match
);
// Author Simple
$social_media_url = $match[0];
$strings = explode('https://', $author_simple);
$name_surname = $strings[0];
echo '<pre>';
echo $name_surname;
echo '</pre>';
echo '<pre>';
echo $social_media_url[0];
echo '</pre>';
$file_id = $line[16];
$file = \Drupal\file\Entity\File::load($file_id);
$uri = $file->getFileUri();
$url = file_create_url($uri);
echo '<pre>';
echo $url;
echo '</pre>';
$media = Media::load($line[16]);
echo '<pre>';
print_r($media);
echo '</pre>';
echo '------------------'; // new line
echo '<pre>';
print_r($line);
echo '</pre>';
}
}
exit();
fclose($dataFile);
}
}
...@@ -27,7 +27,11 @@ function uvf_migrate_uninstall() { ...@@ -27,7 +27,11 @@ function uvf_migrate_uninstall() {
'migrate_plus.migration.taxonomy_term_team_member_csv_import.yml', 'migrate_plus.migration.taxonomy_term_team_member_csv_import.yml',
'migrate_plus.migration.taxonomy_term_themes_csv_import.yml', 'migrate_plus.migration.taxonomy_term_themes_csv_import.yml',
'migrate_plus.migration.user_csv_import.yml', 'migrate_plus.migration.user_csv_import.yml',
'migrate_plus.migration.portfolio_thumbnail_csv_import.yml' 'migrate_plus.migration.portfolio_thumbnail_csv_import.yml',
'migrate_plus.migration.author_simple_portfolio_csv_import.yml',
'migrate_plus.migration.broadcast_csv_import.yml',
'migrate_plus.migration.broadcast_thumbnail_file_csv_import.yml',
'migrate_plus.migration.broadcast_thumbnail_media_csv_import.yml'
]; ];
foreach($configs as $config){ foreach($configs as $config){
$delete = \Drupal::database()->delete('config') $delete = \Drupal::database()->delete('config')
......
...@@ -12,3 +12,12 @@ uvf_migrate.example: ...@@ -12,3 +12,12 @@ uvf_migrate.example:
_form: 'Drupal\uvf_migrate\Form\ExampleForm' _form: 'Drupal\uvf_migrate\Form\ExampleForm'
requirements: requirements:
_permission: 'access content' _permission: 'access content'
uvf_migrate.importcsv:
path: '/uvf-migrate/importcsv'
defaults:
_title: 'UVF Migrate'
_controller: '\Drupal\uvf_migrate\Controller\UvfMigrateController::build'
requirements:
_permission: 'access content'
services:
uvf_migrate.importcsv:
class: Drupal\uvf_migrate\Importcsv
arguments: ['@current_user']
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment