Closed (duplicate)
Project:
Imce CCK Image
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2009 at 13:35 UTC
Updated:
2 Jul 2009 at 20:58 UTC
Hi
I enabled imce field and imce module to store images as gallery. Then i created one feild for imce image.
Then i uploaded images through imce image field. suppose if i want to use any of image from imce browser, i clicked on add button. then that image will apear in respective node. Now my problem is suppose if i dont want to show any of image from imce browser, what to do. There is Remove option. but after i clicked on remove option, that image was in hide but after submitted the page, that image was not going completly. It is showing in node.
What to do if i dont want to show any of image from imce browser
plz help me out....
Comments
Comment #1
ufku commentedComment #2
balumahender commentedComment #3
balumahender commentedHi All,
I fixed this issue by changing small code in java script of imceimage module.
please follow these steps
1.Open imceimage module
2.Find imceimage.js file
3.Go to this function imceimagedelete(targetField)
4. Actual function was like this
function imceimagedelete(targetField) {
var fld_name = targetField.replace(/_/, "-");
$('#edit-' + fld_name + '-0-imceimage-path').val('');
$('#edit-' + fld_name + '-0-imceimage-width').val(0);
$('#edit-' + fld_name + '-0-imceimage-height').val(0);
var img = '#img-area-' + targetField;
$(img).attr('src', 'blank.jpg');
}
But i changed a very little bit code in this function. I just added " g " for string replace
Replace this function
function imceimagedelete(targetField) {
var fld_name = targetField.replace(/_/g, "-");
$('#edit-' + fld_name + '-0-imceimage-path').val('');
$('#edit-' + fld_name + '-0-imceimage-width').val(0);
$('#edit-' + fld_name + '-0-imceimage-height').val(0);
var img = '#img-area-' + targetField;
$(img).attr('src', 'blank.jpg');
}
then Save it execute. Now Remove option(Imce image) will work in respective nodes
Comment #4
yang_yi_cn commentedhi, can you explain the logic a little bit? I'm not very good at the regular expressions, what the 'g' makes difference ?
I'd like to commit this patch if I can understand it.
Comment #5
balumahender commentedHi Yi Yang ,
' g ' makes global string replace in that function where as with out writing ' g ' , string will not be replaced completely. Image is deleted when string replaces with ' - '(hyphen) where string was like ' _ ' (underscore).
Comment #6
danepowell commentedIs this a duplicate? #285842: Removing an image from a CCK field
If so, please mark this issue as such and continue the discussion there. I think they already have a patch that just needs to be ported.
Comment #7
danepowell commented