-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FOIA-0: Another core patch hack to allow XML uploades to work. (#647)
- Loading branch information
1 parent
9262d61
commit 9cfc1d0
Showing
3 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
diff --git a/core/modules/action/action.module b/core/modules/action/action.module | ||
index 0e4229debc..f3ac61db22 100644 | ||
--- a/core/modules/action/action.module | ||
+++ b/core/modules/action/action.module | ||
@@ -61,12 +61,16 @@ function action_migration_plugins_alter(array &$migrations) { | ||
foreach ($migrations as $migration_id => $migration) { | ||
// Add Actions plugins in actions module. | ||
/** @var \Drupal\migrate\Plugin\migrate\source\SqlBase $source_plugin */ | ||
- $source_plugin = \Drupal::service('plugin.manager.migration') | ||
- ->createStubMigration($migration) | ||
- ->getSourcePlugin(); | ||
- if (is_a($source_plugin, Action::class) && isset($migration['process']['plugin'])) { | ||
- $migrations[$migration_id]['process']['plugin'][0]['map']['comment_unpublish_by_keyword_action'] = 'comment_unpublish_by_keyword_action'; | ||
- $migrations[$migration_id]['process']['plugin'][0]['map']['node_unpublish_by_keyword_action'] = 'node_unpublish_by_keyword_action'; | ||
+ try { | ||
+ $source_plugin = \Drupal::service('plugin.manager.migration') | ||
+ ->createStubMigration($migration) | ||
+ ->getSourcePlugin(); | ||
+ if (is_a($source_plugin, Action::class) && isset($migration['process']['plugin'])) { | ||
+ $migrations[$migration_id]['process']['plugin'][0]['map']['comment_unpublish_by_keyword_action'] = 'comment_unpublish_by_keyword_action'; | ||
+ $migrations[$migration_id]['process']['plugin'][0]['map']['node_unpublish_by_keyword_action'] = 'node_unpublish_by_keyword_action'; | ||
+ } | ||
+ } catch (Exception $e) { | ||
+ // Do nothing. This hack added to allow the XML upload to work. | ||
} | ||
} | ||
} |