Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I can't get my file downloads to assign to the user after purchase. I have just upgraded from Drupal 6 to drupal 7. the files do appear when i look at the 'order' but when you go to the user's 'files' page (user/*/purchased-files) it says 'No downloads found'. there is an option to manually add the files. when I use this to manually add the files the website throws up this error:
PDOException: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'expiration' at row 1: INSERT INTO {uc_file_users} (fid, uid, pfid, file_key, granted, expiration, accessed, addresses, download_limit, address_limit) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 144 [:db_insert_placeholder_1] => 644 [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => dPrqZzEB5XwhGOhReVL0zvY6X0Mdwk65o9C1q8Qp1AU [:db_insert_placeholder_4] => 1365500694 [:db_insert_placeholder_5] => 2943341094 [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => a:0:{} [:db_insert_placeholder_8] => 10 [:db_insert_placeholder_9] => 0 ) in drupal_write_record() (line 7106 of /home/sit
es/*.com/public_html/includes/common.inc).
Comments
Comment #1
tgldesign CreditAttribution: tgldesign commentedthanks to the following comment on another post, I realised that the database couldn't handle my file download expiration setting of 50 years. I changed it to 1 year and it worked with no errors (apart from the one time only download link, which is another issue). I remembered '50 years' was not the default setting, but this could be a bug if that setting doesn't work for other users.
http://groups.drupal.org/node/292308#comment-912343
Comment #2
TR CreditAttribution: TR commentedUbercart's default file expiration is "never". If you've overridden this and set your default expiration to 50 years, I would consider that a configuration bug on your part.
time() in PHP returns a Unix timestamp, which is limited because it only uses 32 bits, so it can only represent times up until 2038 (see http://2038bug.com/). Drupal as well only uses 32 bit time, but that's an issue that's being addressed in Drupal core. Ubercart has to live with the infrastructure Drupal provides, unless we re-invent the wheel and develop our own time-handling system. Which we're not going to do.
Comment #3
tgldesign CreditAttribution: tgldesign commentedI just thought there shouldn't be the option to set it to 50 years etc. in ubercart if this happens as a result. My point is that the amount of years should be limited to a safe amount so others don't fall into the trap like I did.
Comment #4
longwaveI guess if we limited expiry to, say, 10 years, that wouldn't harm anyone.
Comment #5
longwaveAlso, this is very similar to #1389692: 2038 ( Y2K38 ) bug with expiration dates
Comment #5.0
longwavesp
Comment #7
msemahi everyone, i woud like to know where does Drupal 7 saves the path of the file that we associate to a product in the data base?
That is because i change the path where i store my files.
Thank you for any help, and... i am new here by the way(i didn´t know where to post this like a brand new question so i putted here )