Just installed 2.0-rc2 on a new site, Drupal 6.11. The primary use of UC will be for file downloads. I did some basic setup with the test payment gateway. Created a product. Purchasing the product worked fine. I realized that I didn't set it up for a download feature. So I went uploaded a file. The upload completed but gave this warning which also shows up in the Drupal log.
Missing argument 3 for uc_file_admin_files_form_action_validate(), called in /home/ribshack/public_html/ribs/includes/form.inc on line 775 and defined in /home/ribshack/public_html/ribs/sites/all/modules/ubercart/uc_file/uc_file.admin.inc on line 337.
However checking the file made it up to the server just fine. So I went on to edit the product and clicked on teh features tab, clicked add for file download, file in the fields picked the file to download, then on save I get a wite screen with just this message.
Fatal error: Cannot use object of type cache as array in /home/ribshack/public_html/ribs/sites/all/modules/ubercart/uc_file/uc_file.module on line 1572
Nothing in the logs when this happens.
Any help, ideas, or further ideas? Let me know if you need anything else about the setup.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | file_cache.patch | 1.6 KB | Island Usurper |
| #3 | file_cache.patch | 1.54 KB | Island Usurper |
| #2 | 452652.ns_cache.2.x.patch | 2.34 KB | cha0s |
Comments
Comment #1
jriedel commentedI think I might have found the type cache as array error.
Another module, phpbbfourm has a block that defines $cache as a global. I made a quick fix by editing uc_file.module and changing all $cache to $uc_cache. I just need to make sure it is not in any other uc files. Editing the other module is not an option becuase it calls some PHP code that is outside of Drupal.
Comment #2
cha0s commentedWhoops, that was my bad. Remember, always namespace your variables! :)
Comment #3
Island Usurper commentedHow about we don't use global variables at all? I guess calling a function to access a static variable by reference isn't actually that much different, but it allows us to take steps towards a less open API for this thing so we can have better control about what gets put into the file cache.
Comment #4
cha0s commentedNo problem, as long as the cat's getting skinned. :)
btw, http://api.drupal.org/api/function/drupal_static/7 is sweet!
Comment #5
Island Usurper commentedForgot to return $cache. That might be important. But it didn't actually cause any errors before I fixed it, but I guess we wouldn't get any since it's just rebuilding the cache every time.
Anywho, the correct version has been committed.