Problem/Motivation

When setting up a field I prefer to specify my own file directories. Typically I will want something like media/images/[date:custom:Y]

After saving the field settings, this preference is not preserved and has reverted to the default value of [date:custom:Y]-[date:custom:m]

Clearly the normal Drupal image form is being used and this always works fine. Could it be that something connected with css settings form is interfering with it?

Steps to reproduce

Setup a background image field and change the default file directory to something other than the default.

After saving field, review again.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

MrPaulDriver created an issue. See original summary.

drupaldope’s picture

can you try if the module file field path solves your issue?
that module is very useful for me
https://www.drupal.org/project/filefield_paths

chike’s picture

Title: Field does not allow custom file directory » Default image and custom file directory do not save
Priority: Normal » Major

In addition to the file directory, default image does not save.

I uploaded an image for 'Default image' and set a custom file directory and set a maximum upload size and clicked 'Save settings'. Then I created a new content, I could see the thumbnail of the default image in the node edit form but after saving the page, the image was not displayed on the page. I went back to edit the field and found the default image was not saved, the file directory was not saved, only the maximum upload size was saved.

The default image is quite a major concern because if one sets a default image then during content creation if there are no images available for the background, the default image can hold the place, but when it doesn't work then content creators must have an image handy to ever make a content, otherwise the background image would not be loaded thereby defacing the page layout.

chike’s picture

I found a related issue.

Storage parameter not save

nicholass’s picture

I landed here because of the same issue I try to add 'webp' to that allowed file extensions and it defaults back to the https://git.drupalcode.org/project/bg_img_field/-/blob/8.x-1.x/src/Plugi... defaults. So these fields seem like they are read only?

nicholass’s picture

To me I think the issue with the file settings is a default is provided but nothing ever "saves" the changes. But I could be wrong as I am not sure on reading the code. See: https://git.drupalcode.org/search?search=file_extensions&nav_source=navb...

jfortune’s picture

Thank you I am now fixing this issue and hope to have it up tonight.

  • JFortune committed 3ff2526e on 8.x-2.x
    Issue #3207619 by MrPaulDriver, chike, NicholasS, DrupalDope, JFortune:...
jfortune’s picture

Status: Active » Fixed
jfortune’s picture

Status: Fixed » Closed (fixed)