Updated: Comment #1
Problem/Motivation
Image field allows site administrator to define default image on field and/or instance level. file_managed Form API element is used to provide this functionality. Form element includes "Remove" button which is used to remove default image form the configuration.
It is easy to reproduce this:
- install Drupal with "Standard" profile
- log in as admin
- navigate to admin/structure/types/manage/article/fields/node.article.field_image
- upload default image
- save configuration
- navigate back to admin/structure/types/manage/article/fields/node.article.field_image
- try to remove default image by clicking "Remove" button
- image stays there
This might be more general problem of file_managed form element. It definitely needs test coverage.
Proposed resolution
No solution found yet.
Remaining tasks
- fix bug
User interface changes
N/A
API changes
N/A
Related Issues
- Bug found in #1205822-23: File(s) silently deleted when #access=false
Comments
Comment #1
slashrsm commentedAdd test tag.
Comment #2
dags commentedI can't reproduce this bug - even with the patch in #1205822: File(s) silently deleted when #access=false applied (which is where this issue originates from). My HEAD is at 988abc2 from 2 days ago.
Comment #3
claudiu.cristeaI was experienced this issue but after last pulls from remote repo it seems gone. I installed a fresh Drupal (
git clone) and seems gone. Have no explanation but I confirm that this happened.Comment #4
slashrsm commentedThat is strange. I was testing in Chromium before and it did not work. Now I tried in Firefox and it seem to work. Could this be browser-dependent issue?
I am also experiencing segmentation faults in apache logs:
I am using PHP version 5.4.9-4ubuntu2.2.
Comment #5
claudiu.cristeaIt might be a PHP 5.4 issue? I'm running 5.4 too
Comment #6
dags commentedI haven't done any further testing but when I tested before I was running PHP 5.3.10.
Comment #7
swentel commentedSeems to be really working - let's close for now.
Comment #8
therobyouknow commentedThis is still a problem in 8.5.4 - for content type with a field of type Media, reference type Media.
Comment #9
therobyouknow commentedComment #10
borisson_Setting to active, there is no patch, so it shouldn't be at needs work yet.
Comment #13
quietone commentedI tested this on Drupal 8.8.x locally and was not able to reproduce the problem.
I followed the steps in the Issue Summary and when removing the default image from the article content type the image was removed.
I also tested media fields because of the comment #8. The Default Value field for the Media field (I added to the page content type) did not have a remove button. However, the default media, which was image, could be removed by removing the value from the field and saving. Also changing the default value to another image worked.
Therefore, closing as cannot reproduce. If you are experiencing this problem reopen the issue, by setting the status to 'Active', and provide complete steps to reproduce the issue (starting from "Install Drupal core").
Thanks!