alanpich / tveasyupload

A simple file-upload TV input filter for MODx Revolution 2.2+
4 stars 15 forks source link

Doesn't switch with existing Image tvs properly #5

Open alanpich opened 11 years ago

alanpich commented 11 years ago

The regular image TV input only seems to store the part of the file url relative to the media source root. When it is called in a template, the value is parsed somewhere and the mediasource root url added to it. SFU should do this too so users can switch between

dustinwalker commented 11 years ago

Great TV.

I think I ran into an issue that this would sort out. When the media source's url isn't set to relative it seems to strip out one of the / in the http:// ... resulting in http:/urlhere.com/

alanpich commented 11 years ago

ahh yes... one of the many hangovers before I realised the power of rtrim... Easy fix, i'll see what i can do over the next couple of weeks to get a new version out.

If you need a quick patch until then the following should work (!untested!)

FILE: core/components/tveasyupload/processors/browser/file/upload.class.php here LINES: 109 - 111

<?php
 /* ... */
    // Change line 109 to this
    $url = $this->source->getObjectUrl(rtrim($path,'/').'/'.$fName); 

    // Remove line 111 completely
    /* $url = str_replace('//','/',$url); */