Created
August 8, 2022 23:32
-
-
Save slattery/e303ccf1a0187065cd350c560f759dca to your computer and use it in GitHub Desktop.
filefield_paths_fix_nothirdpartysettings.patch
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
--- a/filefield_paths.module 2022-08-08 16:04:37.000000000 -0400 | |
+++ b/filefield_paths.module 2022-08-08 19:23:33.000000000 -0400 | |
@@ -212,11 +212,13 @@ | |
// Force all File (Field) Paths uploads to go to the temporary file system | |
// prior to being processed. | |
if (isset($element['#type']) && $element['#type'] == 'managed_file') { | |
- $settings = $context['items']->getFieldDefinition() | |
- ->getThirdPartySettings('filefield_paths'); | |
- if (isset($settings['enabled']) && $settings['enabled']) { | |
- $element['#upload_location'] = \Drupal::config('filefield_paths.settings') | |
+ $definition = $context['items']->getFieldDefinition(); | |
+ if ($definition instanceof ThirdPartySettingsInterface) { | |
+ $settings = $definition->getThirdPartySettings('filefield_paths'); | |
+ if (isset($settings['enabled']) && $settings['enabled']) { | |
+ $element['#upload_location'] = \Drupal::config('filefield_paths.settings') | |
->get('temp_location'); | |
+ } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment