If you get an error message, when trying to list the file downloads you have bought, and the sorting doesnt work, this patch did it for me.
Keep in mind i am no php wizard.

Solved the problem for me though.

Comments

tilmankoester’s picture

Status: Active » Needs review
tr’s picture

Category: bug » support
Status: Needs review » Postponed (maintainer needs more info)

First, I can't reproduce the error at all. Lots of people use file downloads, and no one has ever mentioned this error, so if it's a problem it's likely due to something in your server environment. Did you perhaps experiment with theming the file downloads page before this happened? Possibly the theme cache wasn't flushed.

Anyway, all the patch does is move the construction of the $header array out of the theme function and into the calling routine. It's still the same array, so the move can't possibly have any effect on the operation of the code. Besides, the appropriate place is in the theme function, not outside it.

If you continue to have this problem then I'm going to need more information to help track it down.

tilmankoester’s picture

Ok, call me crazy, but:

1) I set up a fresh drupal 6.16 install on localhost, the only modules i enable are ubercart 6.x.2.2 and token. And it works fine.

2) I set up another fresh copy, this time with 6.x.2.x-dev, click on "My account" > "Files" (user/*/purchased-files) and get an error: "warning: Invalid argument supplied for foreach() in -snip-/includes/tablesort.inc on line 193."

And if I look at uc_files from 6.x.2.2 and from -dev they are quite different but 2.2 builds a $header array pretty much at the same place I do. (Didnt really look closely, sorry if I am missing something)

I know you're stressed man, but I ran into this problem (and can reproduce it, local and on-line), just thought I'd try and chip in what I found.

If you think it's a non existant problem, please feel free to close the issue.

Regards

tr’s picture

I hadn't noticed you were using -dev. I tested on 2.2. I'll go back and have another look with -dev.

tr’s picture

Category: support » bug
Priority: Minor » Normal
Status: Postponed (maintainer needs more info) » Needs review

Yes, you're right. Looks like the patch in #508430: Create theme function for uc_file user download page broke the -dev version. Thanks for catching that. Moving this back to a bug report ...

I'm glad you're using the -dev version, since there have been a lot of changes and it clearly could use testing before a new version is released!

tilmankoester’s picture

StatusFileSize
new1.83 KB

Created a proper .patch against CVS.
Sorry didnt do it in first post, and sorry for specifically saying it's for the -dev version. I was in a rush.

Glad you can reproduce it. Was starting to doubt my sanity.

univate’s picture

Status: Needs review » Needs work

I haven't tested it but the code looks like it should fix that error.

The only things I would suggest are:
* put the header variable first - so it matches the order theme_table() uses.
* update the uc_file_theme function to include the new variable.

tr’s picture

rhimes’s picture

same errors, patch in #6 works for me!

cha0s’s picture

Still broken?

ufku’s picture

Status: Needs work » Needs review
StatusFileSize
new2.44 KB

Handles the issue by introducing a new function returning the header.
No need for a change in theme function.

univate’s picture

StatusFileSize
new2.06 KB

I think I prefer the solution in #6 with the minor suggestions I made in #7.

Attached patch.

Island Usurper’s picture

Status: Needs review » Fixed

Looks good to me. Thanks, guys. Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.