Suggestion for Next C5 Version

Permalink
I'd like to make a suggestion to the powers that be regarding the Form block. Currently around Line 302 of /blocks/form/controller.php is the following:

}elseif($row['inputType']=='fileupload'){
   $answer=intval( $tmpFileIds[intval($row['msqID'])] );
}


However this just returns a file's ID, where the download URL would be much more beneficial and practical. Could you please include something like this instead?

}elseif($row['inputType']=='fileupload'){
   $answer=intval( $tmpFileIds[intval($row['msqID'])] );
   $f = File::getByID($answer);
   $fv = $f->getApprovedVersion();
   $answer = $fv->getDownloadURL();
}

WebSolutions
 
jshannon replied on at Permalink Reply
jshannon
I've never used this and not even sure exactly what this is referring to, but that won't stop me putting in my $.02.... :)

This should instead return the $f. That way you can get the ID or the download URL or the view URL or whatever you want.

James
WebSolutions replied on at Permalink Reply
WebSolutions
The file and the row that I'm referring to is the one that develops the email that gets submitted to the user when a form is filled out. The existing way, the submission looks like this:


Name: blah

Phone: blah

Email: blah

File Uploaded: 186


It is simply placing the id of the file, which for any website user is going to be close to useless, as you'd have to not only log in, but then search through the files.

The way I'm suggesting would render the email as follows:

Name: blah

Phone: blah

Email: blah

File Uploaded:http://www.yoursite.com/index.php/download_file/555/5555...
jshannon replied on at Permalink Reply
jshannon
Ok. Good point. :)

The block_form_submission template is "dumb" and doesn't deal with different object types... just prints out the "answer".