Unable to Remove Files

More
14 years 1 month ago #6058 by flyingtodd
I had attached a file to an article using a custom field. That whole process works just fine, but now I want to delete the file.

I have already deleted the article first, and when I go to "Files" from the Flexicontet dashboard and select the file I wanted deleted and click delete it gives me the following info box

"You cannot remove some (all) of these files. They are still associated to fields. Please remove the associations first!!!"

So how do I remove the association when the article no longer exists, then how do I actually delete file.

Thanks for any help.

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

More
14 years 3 weeks ago #6252 by vistamedia
Replied by vistamedia on topic Unable to Remove Files
Maybe you deleted the article with the standart joomla article manager instead of flexicontent.
That means the extended data aren't removed.
Emmanuel.

FLEXIcontent lead developer.
www.vistamedia.fr web agency and custom development.
www.joomla.fr co-administrator.
Please no PM for support request, use the forum for that!!!

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

More
14 years 3 weeks ago #6275 by flyingtodd
Replied by flyingtodd on topic Unable to Remove Files
OK, you are probably correct.

I just created a new item with a file attachment per my FlexiContent procedure. The file I uploaded appeared correctly in the "file" area with the proper number displayed for assigned. I then deleted the item, through FC, and was then able to delete the file correctly in the file area.

So my next question would be;

If I am showing a file in the file area that has an association, but that item had already been deleted (outside of the FC) system, how do I remove the association so the file can be removed from the system?


Thanks for the system - I am enjoying both FlexiContent and FlexiAccess with AEC integration - They are proving to be a vital part of my church website.

Todd

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

More
14 years 3 weeks ago #6345 by vistamedia
Replied by vistamedia on topic Unable to Remove Files
Thanks for the compliments ;)
Sorry but it will be a little tricky
Open administrator/components/com_flexicontent/controllers/filemanager.php
Search
Code:
/** * Logic to delete files * * @access public * @return void * @since 1.5 */ function remove() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $cid = JRequest::getVar( 'cid', array(0), 'post', 'array' ); $model = $this->getModel('filemanager'); if (!is_array( $cid ) || count( $cid ) < 1) { $msg = ''; JError::raiseWarning(500, JText::_( 'FLEXI_SELECT_ITEM_DELETE' ) ); } else if (!$model->candelete($cid)) { JError::raiseWarning(500, JText::_( 'FLEXI_YOU_CANNOT_REMOVE_THIS_FILE' )); } else { if (!$model->delete($cid)) { JError::raiseError(500, JText::_( 'FLEXI_OPERATION_FAILED' )); } $msg = count($cid).' '.JText::_( 'FLEXI_FILES_DELETED' ); $cache = &JFactory::getCache('com_flexicontent'); $cache->clean(); } $this->setRedirect( 'index.php?option=com_flexicontent&view=filemanager', $msg ); }

Replace by:
Code:
/** * Logic to delete files * * @access public * @return void * @since 1.5 */ function remove() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $cid = JRequest::getVar( 'cid', array(0), 'post', 'array' ); $model = $this->getModel('filemanager'); if (!is_array( $cid ) || count( $cid ) < 1) { $msg = ''; JError::raiseWarning(500, JText::_( 'FLEXI_SELECT_ITEM_DELETE' ) ); // } else if (!$model->candelete($cid)) { // JError::raiseWarning(500, JText::_( 'FLEXI_YOU_CANNOT_REMOVE_THIS_FILE' )); } else { if (!$model->delete($cid)) { JError::raiseError(500, JText::_( 'FLEXI_OPERATION_FAILED' )); } $msg = count($cid).' '.JText::_( 'FLEXI_FILES_DELETED' ); $cache = &JFactory::getCache('com_flexicontent'); $cache->clean(); } $this->setRedirect( 'index.php?option=com_flexicontent&view=filemanager', $msg ); }

And there won't be any association check anymore. Don't forget to put back the original code after you have deleted the uneeded items.

Cheers,
Emmanuel.

FLEXIcontent lead developer.
www.vistamedia.fr web agency and custom development.
www.joomla.fr co-administrator.
Please no PM for support request, use the forum for that!!!

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.568 seconds
Save
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