Thank you very much for developing this module, it works great.
But when you save an expiration date too far in the future (now allowed until December 31, 2050) the following exception is thrown:

PDOException: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'expiration' at row 1: UPDATE {access_code} SET code=:db_update_placeholder_0, expiration=:db_update_placeholder_1 WHERE ( (uid = :db_condition_placeholder_0) ); Array ( [:db_update_placeholder_0] => 123456789 [:db_update_placeholder_1] => 2556140399 [:db_condition_placeholder_0] => 33 ) en access_code_user_update() (línea 201 de /var/www/vhosts/jfmaguire.es/httpdocs/biomedicinalmc/sites/all/modules/access_code/access_code.module).

On my site, I can save dates until 2037 without rising the exception.
I'm using PHP 5.3.23, MySQL 5.5.30 and Drupal 7.21.

Comments

hyperlinked’s picture

Issue summary: View changes

That date bug is explained here:
http://en.wikipedia.org/wiki/Year_2038_problem

I'd say the bug should belong against the date module and not the access code module.

hyperlinked’s picture

I've incorporated this into my patch against issue #2265509:
https://drupal.org/node/2265509

I simply added a date range check to the validation to see if the expiration date is beyond 2037. If it is, then the form sets an error and the user is not saved.

hyperlinked’s picture

Assigned: Unassigned » hyperlinked

  • Commit 649b8dc on 7.x-1.x by Gergely Lekli:
    Issue #1979620 by hyperlinked: Add validation for expiration date.
    
glekli’s picture

Status: Active » Fixed

This issue has been addressed.

hyperlinked’s picture

Status: Fixed » Closed (fixed)

Verified. Closed.