uc_file - Adding file to user skips Description

Project:Ubercart Contributions
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description
Project: 
Ubercart

Just testing the File Downloads area under user/#/edit and noticed that using the select list adds the file to the user, but does not send a pfid. Thats required for getting the description in the My Files list.

So, its an easy fix. At line 155, change this:

<?php
_user_table_action
('allow',$fid,$account->uid);
?>

to this:

<?php
$pfid
= db_result(db_query("SELECT `pfid` FROM {uc_file_products} WHERE `fid` = %d", $fid));
_user_table_action('allow',$fid,$account->uid,$pfid);
?>

I still think in some cases it'll be easier to add a product, and let the system assign all files currently attached to the product, as I did here. Might work well as a Contrib, or an addition to my uc_file_retro Contrib.

(It also occurred to me that I could probably fix the autocomplete / Secure Pages issue by adding the autocomplete path to the S.P. config .. d'oh!)

EDIT: Also, to the $files db_query above (that builds the select list) I added "ORDER BY filename" to make the list a little easier to read Smiling

Shawn Conn's picture
Offline
Administrator
Joined: 08/07/2007
Juice: 916
Re: uc_file - Adding file to user skips Description

Good call on both the ordering of files & not caching the $pfid. Committed to bazaar.

-Shawn Conn: If the Name Don't Rhyme It Ain't Mine

royerd's picture
Offline
Joined: 01/22/2008
Juice: 293
#2
Category:» bug report
Assigned to:Shawn Conn» Guest

Quite an old post here, but in D6 version this is still an issue--no description added. Is there a fix that would work? I don't see these lines in the uc_file module.

Dan