Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
content_synchronizer
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
content_synchronizer
Commits
0432cddf
Commit
0432cddf
authored
1 year ago
by
George
Committed by
Thomas Secher
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3299726
by geoanders: Taxonomy terms are not reset
parent
4a3bd7fb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!4
Issue #3299726 by geoanders: Taxonomy terms are not reset
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Processors/Entity/EntityProcessorBase.php
+10
-4
10 additions, 4 deletions
src/Processors/Entity/EntityProcessorBase.php
with
10 additions
and
4 deletions
src/Processors/Entity/EntityProcessorBase.php
+
10
−
4
View file @
0432cddf
...
...
@@ -85,6 +85,8 @@ class EntityProcessorBase extends PluginBase implements EntityProcessorInterface
*
* @return bool|string
* The gid if exported, False either
*
* @throws \Drupal\Core\TypedData\Exception\MissingDataException
*/
final
public
function
export
(
EntityInterface
$entityToExport
)
{
// If entity is exportable (content entity).
...
...
@@ -229,6 +231,8 @@ class EntityProcessorBase extends PluginBase implements EntityProcessorInterface
*
* @param array $dataToImport
* The data to import.
*
* @throws \Drupal\Core\TypedData\Exception\MissingDataException
*/
final
public
function
import
(
array
$dataToImport
)
{
$gid
=
$dataToImport
[
ExportEntityWriter
::
FIELD_GID
];
...
...
@@ -406,6 +410,8 @@ class EntityProcessorBase extends PluginBase implements EntityProcessorInterface
*
* @return array|bool
* The data to export.
*
* @throws \Drupal\Core\TypedData\Exception\MissingDataException
*/
public
function
getDataToExport
(
EntityInterface
$entityToExport
)
{
$dataToExport
=
[];
...
...
@@ -429,15 +435,13 @@ class EntityProcessorBase extends PluginBase implements EntityProcessorInterface
foreach
(
$entityToExport
->
getTypedData
()
->
getProperties
()
as
$propertyId
=>
$propertyData
)
{
// Check properties to export
:
// Check properties to export:
if
(
!
in_array
(
$propertyId
,
$propertyIdsNotToExport
))
{
/** @var \Drupal\content_synchronizer\Processors\Type\TypeProcessorBase $plugin */
if
(
$plugin
=
$this
->
getTypeProcessorManager
()
->
getInstanceByFieldType
(
get_class
(
$propertyData
))
)
{
if
(
$fieldDataToExport
=
$plugin
->
getExportedData
(
$entityToExport
->
get
(
$propertyId
)))
{
$dataToExport
[
$propertyId
]
=
$fieldDataToExport
;
}
$dataToExport
[
$propertyId
]
=
$plugin
->
getExportedData
(
$entityToExport
->
get
(
$propertyId
));
}
}
}
...
...
@@ -452,6 +456,8 @@ class EntityProcessorBase extends PluginBase implements EntityProcessorInterface
* The data to import.
* @param \Drupal\Core\Entity\EntityInterface $entityToImport
* The existing entity to update.
*
* @throws \Drupal\Core\TypedData\Exception\MissingDataException
*/
public
function
getEntityToImport
(
array
$data
,
EntityInterface
$entityToImport
=
NULL
)
{
if
(
$entityToImport
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment