Hello everybody...
I'm creating a free file download site (only registered users can purchase and download files) and need help. I download a purchased file, the counter for Downloads goes from 0 -> 1 and the Addresses stays at 0 (it should go to 1 right?). When I want to refresh or go to another page this what happens:
Notice: Undefined property: stdClass::$addresses in _uc_file_log_download() (line 423 of C:\xampp\htdocs\drupal\sites\all\modules\ubercart\uc_file\uc_file.pages.inc).
Warning: in_array() expects parameter 2 to be array, null given in _uc_file_log_download() (line 424 of C:\xampp\htdocs\drupal\sites\all\modules\ubercart\uc_file\uc_file.pages.inc).
Notice: Undefined property: stdClass::$accessed in _uc_file_log_download() (line 430 of C:\xampp\htdocs\drupal\sites\all\modules\ubercart\uc_file\uc_file.pages.inc).
Notice: Undefined property: stdClass::$fuid in drupal_write_record() (line 7188 of C:\xampp\htdocs\drupal\includes\common.inc).
(As you can see I'm using xampp and windows for local server)
And the counter for Downloads goes back to 0. At my database, in table uc_file_users there are "addresses" always a:0:{} and "accessed" 0. What is wrong with this?
Comments
Comment #1
deathL CreditAttribution: deathL commentedComment #2
deathL CreditAttribution: deathL commentedComment #3
TR CreditAttribution: TR commentedSounds like your uc_files table is corrupted. The addresses property is defined and populated by the db_query of the uc_files table. If you have an addresses column in the table, you shouldn't get this notice. Assuming you're using just core Ubercart and no contributed modules which may affect this behavior ...
Comment #4
deathL CreditAttribution: deathL commentedThanks for your answer. Hmm i'm using Product Minimum & Maximum and Ubercart Disable Store also. I can only see addresses property in uc_file_users table and not in uc_files table (only fid and filename).
Oh damn could it be because i've tempered with Workflow rule? I've added new rule:
Events -> Customer starts checkout
Conditions -> User has role(s): admin, authenticate to match any site:current-user
Actions ->
Comment #5
deathL CreditAttribution: deathL commentedfound a exact situation with a different error: https://drupal.org/node/561692
Edit: i've tested with a fresh project (only core ubercart modules + extra: file download and roles). edited the Rules condition of:
(edited the rules to test download files) and still get the same error :/. i don't know if this helps: i'm testing this on localhost server Xampp
Edit 2:
ok, i have forgotten that normal users will download the files and the test shows that it works. so only admin users will have problems with this. i assume that the answer is described in this issue Corrupt download file and $address error.
Comment #6
TR CreditAttribution: TR commentedIf it's the same as #2133625: Undefined property: stdClass::$addresses in _uc_file_log_download(), then please contribute to that thread to help resolve this.