[OBSOLETE][MM]Media Manager uploading into selected folder - Joomla! Forum - community, help and support


i posted fix media manager not uploading right folder , moderator suggested post here in case has not been fixed in nightly builds.

fix post:
http://forum.joomla.org/index.php/topic ... #msg947053

hhopkins wrote:until there official patch, here's how got manager work way think intended to.  there 2 files update , have included before , after code.  worked me, best of luck all.

uploader js file (media\system\js\uploader.js):
around line 119 there function called "upload".  here's original code followed changes.

original code
upload: function(e) {
if (e) e.stop();
this.uploader.send(this.options.url);
},

changes
upload: function(e) {
var dirpath = document.mediamanager.getfolder();
if (e) e.stop();
this.uploader.send(this.options.url+'&dirpath='+dirpath);
},

you'll notice added 'dirpath' end of url because current url being sent includes base path , not current working folder.  current working folder reading 'mediamanager' object.  upload script found in controller.php file in component tries read 'dirpath' request variable, empty.  hence why files uploaded root folder.

the next changes folder refresh iframe once files uploaded.  refreshed root folder.  again, code did not take account current working folder.  below original code , changes.

media component html file (administrator\components\com_media\admin.media.html.php):
this initial call made create fancyupload object , options set.  around line 65 see line calling behaviour.uploader routine.

original code

jhtml::_('behavior.uploader', 'file-upload', array('onallcomplete' => 'function(){ $(\'folderframe\').src = $(\'folderframe\').src; }'));

changes
jhtml::_('behavior.uploader', 'file-upload', array('onallcomplete' => 'function(){ $(\'folderframe\').src = $(\'folderframe\').src+\'&folder=\'+document.mediamanager.getfolder(); }'));

the part highlighted in red function called once files uploaded.  because iframe updated via links in folder tree in media manager, 'src' property not reflecting complete current working directory.  again changed accessing mediamanager object.

i realize sort of hack, helps until there official patch.  non-techies have attached both files changed.  rc1 release , not nightly builds.

tested on ie6, ie&, & ff2, on windows.  sorry, not mac user.

'h


looks fixed: http://forum.joomla.org/index.php/topic,191753.0.html

would mind test latest svn?

cheers





Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'