Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
499e358a
Unverified
Commit
499e358a
authored
Feb 20, 2021
by
alexpott
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#3197749
by quietone, joachim: empty migrate source does not populate fields with constants
parent
203ad064
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
core/modules/migrate/src/Plugin/migrate/source/EmptySource.php
...modules/migrate/src/Plugin/migrate/source/EmptySource.php
+3
-2
core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php
...es/migrate/src/Plugin/migrate/source/SourcePluginBase.php
+16
-0
No files found.
core/modules/migrate/src/Plugin/migrate/source/EmptySource.php
View file @
499e358a
...
...
@@ -15,8 +15,9 @@
* field_name: image
* @endcode
*
* This will return a single row containing 'entity_type' and 'field_name'
* elements, with values of 'user' and 'image', respectively.
* This will return a single row containing 'constants/entity_type' and
* 'constants/field_name' elements, with values of 'user' and 'image',
* respectively.
*
* @MigrateSource(
* id = "empty",
...
...
core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php
View file @
499e358a
...
...
@@ -24,6 +24,8 @@
* (optional table alias). This high_water_property is typically a timestamp
* or serial id showing what was the last imported record. Only content with a
* higher value will be imported.
* - constants: (optional) An array of constants that can be used in the process
* pipeline. To use the constant 'foo' as a source value use 'constants/foo'.
*
* The high_water_property and track_changes are mutually exclusive.
*
...
...
@@ -58,6 +60,20 @@
* migration. This will get converted into a SQL condition that looks like
* 'n.changed' or 'changed' if no alias.
*
* Example:
*
* @code
* source:
* plugin: some_source_plugin_name
* constants:
* - foo: bar
* process:
* baz: constants/bar
* @endcode
*
* In this example, the constant 'foo' is defined with a value of 'bar'. It is
* later used in the process pipeline to set the value of the field baz.
*
* @see \Drupal\migrate\Plugin\MigratePluginManager
* @see \Drupal\migrate\Annotation\MigrateSource
* @see \Drupal\migrate\Plugin\MigrateSourceInterface
...
...
alexpott
@alexpott
mentioned in commit
71457028
·
Feb 20, 2021
mentioned in commit
71457028
mentioned in commit 714570280d7f86bf36e36e89bbb4ab3f3df8c766
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment