New answers tagged


Curently is not possible using core to transliterate uploaded filenames (referer to this and this core issues). To solve this you need to use the Transliterate filenames for uploads module. Check the comments from above.


I think you just need to adjust your submission handler; don't include the fieldset "options_settings". I use the getValue() method and pass it an array of values, the form key and the index of its value. if ($file_id = $form_state->getValue(['header_background', '0'])) { $file = \Drupal::entityTypeManager()->getStorage('file')->load($file_id)...


You can edit the permissions of the folder it self. The folder "default" set to 0555, set them to 0755 for editing. Don't forget to restore the default values afterwards!


I had this problem too. Problem for me was solved by changing Private files setting (in settings.php) to NOT be absolute. Instead make it RELATIVE to Drupal installation. In my case this worked: $settings['file_private_path'] = '../private'; Drupal documentation in settings.php says that you should use an absolute path, which seems to be misleading.


From the link posted in the answer above it specifically states NOT to put the Private folder within docroot: "add the url path to your private directory. It must exist outside of your web root directory and be an absolute path, for example /var/www/html/ with web root in/var/www/html/ or /home/username/ ...


I used hook_field_widget_form_alter as suggested by DannyEnglander and leymannx. 8.8.x hook_field_widget_form_alter Replace MYMODULE with your custom module's name and alter the element array to suit your needs. /** * Implements hook_field_widget_form_alter(). */ function MYMODULE_field_widget_form_alter(&$element, \Drupal\Core\Form\...

Top 50 recent answers are included