Deleting items, image/gallery field needs to remove images

More
11 years 9 months ago #40062 by igcorreia
When I delete 1000 items does flexi also delete the images and downloads from that are from this items?

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #40066 by ggppdk
Hello

FLEXIcontent has event function onBeforeDeleteField,

this function is called during CONTENT Item deletion,
.. but currently it is empty for image field !

-- for image fields in folder mode , it should delete the folder with the images, but this was missed


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #40067 by igcorreia
I see, I notice because I was trying to gain disc space from a large site and when I deleted it nothing change :)

Take this as a feature request.

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #40068 by ggppdk
Hello,

actually deleting folder image filed in folder mode is only a few lines of code,
AND since images are not reusable they should really be deleted:

(if you would want to use now)
Code:
// Method called just before the item is deleted to remove custom item data related to the field function onBeforeDeleteField(&$field, &$item) { $image_source = $field->parameters->get('image_source', 0); $dir = $field->parameters->get('dir'); if ($image_source) { jimport('joomla.filesystem.file'); jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.jpath'); // Delete image folder if it exists $destpath = JPath::clean( JPATH_SITE .DS. $dir . DS. 'item_'.$field->item_id . '_field_'.$field->id .DS); if ( JFolder::exists($destpath) && !JFolder::delete($destpath) ) { JError::raiseNotice(100, $field->label .': Notice: Unable to delete folder: '. $destpath ); return false; } } }


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #40069 by igcorreia
It is too late I have already delete the items i cannot bring them back :(

Thanks.

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #40093 by ggppdk
Hello,

anyway, thanks for noting this

as this code was missing, we added it
(will be in next public package)

this is more like a bug than a feature since these images are not reused (when image/gallery field is in folder mode) so keeping them is erroneous


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.936 seconds
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save