Problem/Motivation
When creating a new image field, you can select a default image for the global field settings. Upon saving, you then see another default image widget that applies only to the field instance. It can be confusing as it might seem that the default image you set was not saved.
To reproduce:
- Install Drupal
- Add a new image field to a content type
- In the first screen, select a default image and save
- On the next screen, see there is an empty default image widget
Proposed resolution
Based on #17, update the wording of the text to make it more obvious that one is the global field setting and one is the instance setting.
The wording of the field settings note is "These settings apply to the [field name] field everywhere it is used. These settings impact the way that data is stored in the database and cannot be changed once data has been created."
And on the edit settings "If no image is uploaded, this image will be shown on display and will override the field's default image."
Comment | File | Size | Author |
---|---|---|---|
#26 | Screenshot 2020-07-17 21.05.27.png | 46.18 KB | pameeela |
#26 | Screenshot 2020-07-17 21.05.44.png | 24.39 KB | pameeela |
#9 | Screen Shot 2013-05-26 at 6.37.29 AM.png | 45.6 KB | harry99 |
#2 | file-defaultimage-1999232-2.diff | 601 bytes | tlherr |
screenshot.png | 73.36 KB | johnheaven |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedConfirming that you cannot remove/change the default image for a field after creation, attempting to resolve.
Comment #2
tlherr CreditAttribution: tlherr commentedFile Ids were not being cleared for non multiple file fields. Patch removes relevant file ID.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedAppears to solve issue and allows changing default image. Impacts the file field in general.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedSetting back to needs review to get some more eyes on it
Comment #5
aspilicious CreditAttribution: aspilicious commentedWe need a test.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedNeeds further investigation.
Something else is happening with regards to the the managed_file field used. Image/file fields run through the same submit callback and don't exhibit the same issue.
Comment #7
harry99 CreditAttribution: harry99 commentedI tried to work out few more things in details about this issue.
When you create new content types for "image", you get two options for choosing upload destination 1. Public flies 2. Private flies.
On FIELD SETTINGS we get option to choose default image. The text below says: "If no image is uploaded, this image will be shown on display."
Next, moving on EDIT menu default image box appears empty, Here text below says: "If no image is uploaded, this image will be shown on display and will override the field's default image." So, we really don't need to upload the same image here even though its empty and it will still display the same image which we uploaded on FIELD SETTINGS after you create content. However, the words had been used to explain under the box are very confusing!!
Second thing is, try choosing different image on EDIT menu than it will override the image we uploaded on FIELD SETTINGS while creating image content and it will display the image we have chosen on EDIT menu.
Comment #8
harry99 CreditAttribution: harry99 commentedChoosing upload destination as Public Flies.
Everything seems working fine either choosing different image on EDIT menu or leaving blank or choosing same image as FIELD SETTINGS.
However, after uploading image either place it's not letting remove it!
Choosing upload destination as Private Flies.
Here, image does not show up on the page after creating content type. Even though choosing same image or different or not choosing any image on EDIT menu.
Once, image is uploaded, it's not letting it remove from EDIT menu or FIELD SETTINGS.
Comment #9
harry99 CreditAttribution: harry99 commentedAfter creating & publishing content type with upload destination as Private Files, image will not be displayed on content page.
1. On content published page try copying broken image URL.
2. Paste that URL on new tab and you will get message saying ACCESS DENIED
This message will pop up even though you are logged in as ADMIN.!!
I think image is uploaded on private files but for some reason its not accessible.
I tried this same thing with iTerm to see if image file is there or not. Same thing happened it shows you image is there but will get message saying Permission Denied.!! to access!
So, I think default image filed is working but the real issue is something else.
Comment #10
swentel CreditAttribution: swentel commentedThis is indeed a weird situation. The default image on the 'Edit' tab work fine. But you can also upload a default one on the 'Field settings' tab. Weird, we should fix that :)
Comment #11
swentel CreditAttribution: swentel commentedComment #12
YesCT CreditAttribution: YesCT commentedIirc, one sets the gloval default for all field instances, the other sets a default for that particular filed instance.
Next steps:
Verify and Summarize the current behavior in the issue summary with exact steps to reproduce for the various situations.
Suggest what the behavior *should* be.
Comment #13
claudiu.cristeaWell, the original issue is talking about something totally different from the last part.
For the behavior described by @hardik.patel99 in #7, #8, #9 I opened #2107455: Image field default value not shown when upload destination set to private file storage.
Comment #14
swentel CreditAttribution: swentel commentedRenaming title also a bit, it's probably not redundant, but still confusing I guess.
Comment #15
ifrikI came across this problem while writing the hook_help text #2091337: Update hook_help for Image module - and I'm not sure what the functionality is supposed to be.
In any case it is currently a usability bug that you the site administrator can set two Default images, one of which overwriting the other.
Comment #16
ifrikI forgot to add the description of how you can currently add two different default images:
In my current D8 installation, I can add a default image on the "Field settings" tab - and it does not show up on the "Edit" tab. Instead I can either leave the default image on the edit tab blank (then it displays the one from the field settings tab with new content) - or I can add a second default image that is then displayed.
If I re-use the image field then it takes default image on the Field settings page, but not the one on the Edit page.
Comment #17
jhodgdonI don't think this is so bad now.
When you create an Image field, there is still a setting for the Default Image.
Then in the instance settings (or whatever they are called, the specific settings that say "these are the settings for this content type", it says:
If no image is uploaded, this image will be shown on display and will override the field's default image.
So... This text is not all that prominent and maybe it's not all that clear, but probably all we would need to do here is to update this text and make it more obvious... but at least the explanation is there.
Comment #26
pameeela CreditAttribution: pameeela commentedComment #27
pameeela CreditAttribution: pameeela commentedComment #31
larowlanOn the basis of #17 and #27 this sounds like it is done now