Hi,

Not sure if this has been reported before - apologies if it has (my quick investigation did not show any positive results).

These are the steps to reproduce the issue.
1. create new article, edit title, upload image, edit body and the rest of the parameters.
2. Promote to front page
3. visit home page and click on the device icon and select edit
4. trying to remove the image by clicking on remove will not remove it!

I'm testing on localhost using chrome.

Many thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

valderama’s picture

I guess the same problem also hinders me to remove images.

I am having a custom content type with an image field with unlimited images. I cannot remove any image once I added it.

drupal: 7 alpha 5
theme: seven
browser: ff3.6

mermentau’s picture

I am having the same problem. The only difference is that my D7 alpha 5 is on a hosted server. Also I can't upload .jpg images. .pgn and .gif work fine. Probably need to make another issue on that.

yched’s picture

Marked #817752: Unable to remove files that have been uploaded using field_file as duplicate.

Very possibly related (if not plain duplicate) : #819816: (Needs tests) Reordering multivalue file and image field uploads is broken

@bumpaw: yes, different issue. Please open a new one for this.

tsi’s picture

Status: Active » Closed (duplicate)

@yched - I don't think #819816: (Needs tests) Reordering multivalue file and image field uploads is broken is a dup of this one, as this is an ajax issue that is "solved" when disabling JS in your browser, the other one is not.
This IS a duplicate of #737686: Image field 'Remove' button broken which is probably a part of #756762: AJAX should follow same rules for whether to call drupal_rebuild_form() as non-AJAX submissions.

eojthebrave’s picture

Component: base system » image.module

Moving to image.module component so I remember to look at this again. And subscribe.

ryan.armstrong’s picture

Subscribe. I am having the same issue on alpha 5. My site is hosted on a dedicated server.

Edit: After reading around more, I found out that this issue has been resolved in the latest HEAD, and may also be in Alpha 6, but I'm not 100% sure of that.

trickar’s picture

Version: 7.0-alpha5 » 7.0
Status: Closed (duplicate) » Active

I have the same problem in my new installation downloaded yesterday. I downloaded the recommended release. The image remove button in my article works fine in Firefox but not in IE7.0 or IE8.0. Please can you help?

bellagio’s picture

I have the same problem (version 7.0). Unable to remove image (image field) from IE8: when click on remove button, small timer icon shows then image is still not removed.
but i can remove the image from the same node in firefox.

peturkirke’s picture

I got exactly the same problem as bellagio.
Also when i upload with IE 8, the new image is not shown. But after i save all changes, i can see the new image.

elizarraraz’s picture

subscribing

enrikito’s picture

subscribing (IE7/8)

lpedretti’s picture

Had the same problem, firebug was throwing an error in the forms js library. I had installed jquery update.

Changed the jquery version inside the "replace" dir from 1.5 to 1.4.4 and the problem was solved.

I think 1.5 is not yet very fine tuned or that drupal itself is not yet ready for it.

Regards!

droplet’s picture

everyone have this problem under IE, please test with -dev version, I remember that have an issue thread already fixed for it.

bellagio’s picture

Dev version (drupal-7.x-dev.zip) with IE8: i am able to upload/remove image with image filed. Thank you.

eelco’s picture

+1

eelco’s picture

+1

hansrossel’s picture

Status: Active » Closed (duplicate)

Fortunately this got fixed and will be a part of 7.1. See #1018714: Image Upload Widget Not Working in IE8.
If you want to fix this in your installation now, you can either use the 7.x-dev version, or apply the patch in the aforementioned issue.
Marking this as duplicate.

dwchris’s picture

Can you explain to me how to apply this patch that I found for updating the jquery (jquery_update_add_more_files.patch) or how to apply the fix mentioned in this thread by lpedretti? Thanks.

droplet’s picture

@dwchris,
http://drupal.org/patch/apply

or update to Dev version (I think it is more stable than 7.0)

alexidze’s picture

I had the same problem with Drupal 7.0 , i have updated to 7x.dev but the problem did not fix.
I'm totally lost, could you help please.

StryKaizer’s picture

Same issue.

I can't delete an image, once I submitted a file. No error
Turned off javascript, error still occurs.

The image is a field in a taxonomy term. I'll do some more tests, and provide more info asap

amplogik’s picture

Version: 7.0 » 7.16
Status: Closed (duplicate) » Active

I have exactly the same problem on the latest 7.16 core. Clicking on the delete image button shows the little "loading" animation and does nothing. I did not have this problem in 7.14, so it appears that the previous problem has crept back into the code.

This is somewhat vexing, as lots of people have the problem, and it keeps coming back by the look of it, and the problem keeps getting marked as closed without any real solution.

It would be nice if the fix for 7 managed to make it into current. Thanks.

aspilicious’s picture

@amplogik what browser are you using? Can you give information about results with other browsers?

Neo13’s picture

I am also having this problem in all browsers.

klucid’s picture

I am also having this problem.

I also noticed that once an image is attached to the node, I am prevented from saving the node as well. There is no entry in the error log and there is no system message displayed. The node/edit form is simply refreshed.

Edit: I've been doing some testing and it seems that when I browse for my image and click the upload button (to upload via AJAX), the node will not save. However, Browsing for the file and saving the node before uploading the file allows me to save. Hope this helps solve the problem.

EugenMayer’s picture

Still valid with 7.17, does not work with WebKit (Chrome/Safari), neither FF - did not test IE but i rather suggest its not a browser thing.

jci’s picture

I also had this problem. To solve it in my current situation I had to deactivate the jquery_update module. that solved it for me but does not seems to be a real solution, but after all I can use my nodes and replace existing images - hope helps somebody ;)

aspilicious’s picture

jquery update module is not a core module so it looks like there is a conflict with core js and contrib js.

EugenMayer’s picture

i dont have jquery_update installed and it does not work, so it cant be directly / exculsivly related

deanflory’s picture

I'm also getting this error when attempting to "Remove" a default image:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /file/ajax/instance/settings/default_image/form-...
StatusText: parsererror

I think there are some general major AJAX error in Drupal and/or contributed modules. Had some in D6, having lots more in D7. Fixes in D7 core and contributed modules haven't addressed the issues all this year (2012).

Neo13’s picture

This is still present in current version.

goron’s picture

I'm getting this error also, latest version of Drupal 7 installed, not running jQuery Update. I don't see an AJAX error, the button just doesn't work.

EDIT: It's actually not just the Remove functionality. Also the ajax Update button doesn't work. Just spins, finishes spinning, and does nothing. Saving the form still takes care of the upload, but then it can't be removed. Note also that I'm doing this not just on Articles, but other node types as well.

goron’s picture

Ok, I traced it down in my case at least to the fact that the form was set to not cache (in a form alter). Ajax callbacks will not work if a form is not cached (which unfortunately doesn't seem to be documented on the AJAX pages) - you can see some discussion of this in #774876: Form cache entries can expire before their host page's cache entry, resulting in all AJAX failing. Once I removed this, image field was working fine.

So if you're having this problem, try to see if something (custom code, contrib code) is preventing your form from caching.

EugenMayer’s picture

It is documented that any multipart-form needs caching, if its a uploadig. The file-upload field even sets this in the form, this is CORE-api. it could be an issue though, if there are fields handling this kind of output or other contribs simply overriding this.

Much more likely is a broken cache . For me, the issue simply dissapeard and iam yet not sure what it was, but i can exclude some thing for you:
- it is not related to jquery_update, i have jquery_update installed
- it is not realted to jquery_ui, i have 1.7.1

Neo13’s picture

In my installation the cause was UC Ajax Cart module.

crispymix’s picture

Hi all - just wanted to say that I had this on my installation and actually it was indirectly related to jquery update. More specifically, the error would only go away if I used jQuery 1.7+

agarwal.sudhanshu’s picture

Subscribing - facing same problem,

k0nG’s picture

Version: 7.16 » 7.10

Having the same issue.

Using Drupal 7.10 and trying to delete a image from a field attached to a taxonomy term.

If I turn off javascript it works correctly.

Is there any safe way of making the form not use the ajax method of deleting and default to the non javascript method?

freephile’s picture

Version: 7.10 » 7.21

Same issue. Drupal 7.21 Can't delete image from article. Spinner appears but nothing happens.

Workaround: disabling Javascript in the browser to edit the article works, and then you have to enable javascript again.

flock’s picture

I confirm this.

heshanlk’s picture

Status: Needs review » Active
FileSize
1.19 KB

Usually Drupal does not delete file if they have some reference and there is a risk of missing reference to the file if we delete it in a one place. So I think the best thing to do is check the number of references and delete if there is only one reference and which is the one we are deleting. This patch might need to clean up a little but this works fine for me. Deleting reference before deleting the file is not recommend since usually files should be removed before it's database reference is deleted, so there should be a better solution for this.

heshanlk’s picture

Status: Active » Needs review

Status: Active » Needs work

The last submitted patch, 817668-removing-files-does-not-work-41.diff, failed testing.

j0rd’s picture

Same issue as #39. Press "Remove", spinner shows up, image doesn't go away.

This is a problem for me in IE9. Chrome & Firefox seem to work just fine.

This is a larger problem for me, as my file image input is set to 1 entry, and I'm defaulting the image already. So in order for users to update the image they have to remove it first (not working), then upload a new one.

9tin’s picture

Subscribing

cvharris’s picture

same problem here, only for Drupal 6.28. Images that were uploaded can't be removed without breaking the whole page. Happens in all browsers, including Chrome.

kappaluppa’s picture

I am having the same problem. I am on Drupal 7.24 and have added image fields to the user profile. I cannot delete an image file in order to replace it. I have two instances of using an image field for this. I get the spinner, but nothing happens. I get an ajax message: Invalid form post data. This was also happening on Drupal 7.23.

I did not have jquery update installed yet this was happening. I actually installed it and tried 1.5, 1.7, 1.8 still no ajax love here.

I have a lot of custom fields in field groups. I tried removing the field from a group to see if it would work on its own, no go.

I did, however try adding an image field to a site where there are not a lot of custom fields. I was able to delete the image. However, if I want to replace the image I have to delete then save, then view, then edit, then add a new image file, then save again.

cvharris’s picture

My issue was solved by simply updating Drupal core, 6.28.

cvharris’s picture

My issue was solved by simply updating Drupal core, 6.28.

sanj’s picture

Hi i too had that problem. i simply upgraded the jQuery module
go to https://www.drupal.org/project/jquery_update
after i can delete images like charm.
aslo make sure to keep the copy of your previous j query module as a back up in case if anything not working on your site with new update, to roll back

Jose Reyero’s picture

Issue summary: View changes

I was getting the same error as #39. This can be caused by any other contrib module causing js errors on the page. Check out the js console for errors.

For me it was the 'Highlight' module, see https://www.drupal.org/node/2002004#comment-9623723

sylvain lavielle’s picture

Hi all,

I had the same error, it was caused by a javascript error when I was using the rubik theme as administration theme. Having the administration theme set to Bartik, solved the problem for me. I hope this may help someone

kopeboy’s picture

I found out the problem was not my theme but the Administration language being different from the current or default language!
Therefore I think the problem depends entirely on the "admin_language" module

My case:
default site & primary language: italian
default administration language: english
my user language: italian

If I was editing the content as administrator I had the problem:

  1. removing an image caused an ajax refresh that shows a message in place like "node as been updated", without the image being removed
  2. re-clicking on the remove button would now remove it, but
  3. saving the node will show en error like "The content of this page has been modified...", preventing you from saving the node, ever.

If I was editing the content as a normal user (in english OR italian) but with Admin language module not impacting the language, no problem was present.

jbcbirder’s picture

I found recently that I was still having this problem (even today after update to core version 7.42). For me having the Seven Theme as my Admin Theme was causing this problem. I changed to Bartik and am now able to remove images (from image fields) and upload new ones. EDIT - I also have to add that rolling jquery back from 1.10 to 1.8 using the jquery update module was also essential.

badcrocodile’s picture

I was facing this same issue. It was caused by the Radioactivity module. Found at fix for it at https://www.drupal.org/node/2555141

Revathi Manohar’s picture

hi, i have tested for drupal 7.42 working fine.no need for patch

hgoto’s picture

@kopeboy thank you for sharing the solution #53. I met the exactly same problem as you met. It was tricky but I could solve it with your comment.

EDITED: The problem with Admin Language module was already solved. I'd like to share the related issues for guys down the road :)

Pere Orga’s picture

Version: 7.21 » 7.x-dev

In Drupal 7.56, this can be reproduced in environments that add the following HTTP header:

X-Frame-Options: DENY

The errors in my console were:

Refused to display 'http://XXXXXXX/file/ajax/field_imatge/und/form-UeITgPMalHNeMIPyrtw3UemRMp8oj5SE5LEGmAnsjFc' in a frame because it set 'X-Frame-Options' to 'deny'.
/file/ajax/field_imatge/und/form-UeITgPMalHNeMIPyrtw3UemRMp8oj5SE5LEGmAnsjFc Failed to load resource: net::ERR_BLOCKED_BY_RESPONSE

When using X-Frame-Options: SAMEORIGIN, it works fine.