Skip to content

Commit

Permalink
FOIA-0: Another core patch hack to allow XML uploades to work. (#647)
Browse files Browse the repository at this point in the history
  • Loading branch information
brockfanning authored Aug 30, 2024
1 parent 9262d61 commit 9cfc1d0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@
"FOIA-32: Exclude Agency/Component from validation for bulk publishing": "./patches/FOIA-32-validator.patch",
"2869592 - Disabled update module shouldn't produce a status report warning": "https://www.drupal.org/files/issues/2024-07-16/2869592-disabled-update-module-71.patch",
"2230909 - Simple decimals fail to pass validation": "https://www.drupal.org/files/issues/2024-06-04/2230909-321.patch",
"Hacks related to file_entity to get XML upload to work": "./patches/managed-file-hacks-for-xml-upload.patch"
"Hacks related to file_entity to get XML upload to work": "./patches/managed-file-hacks-for-xml-upload.patch",
"More hacks related to action module to get XML upload to work": "./patches/migrate-action-hack-for-xml-upload.patch"
},
"drupal/password_policy": {
"Config install issues": "https://www.drupal.org/files/issues/2022-10-04/password_policy_field_last_password_reset_unknown_error_2771129-134.patch"
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions patches/migrate-action-hack-for-xml-upload.patch
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.
}
}
}

0 comments on commit 9cfc1d0

Please sign in to comment.