Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-6464 now.

custom profile field date type: invalid range (fix completed in vcs)

If a custom profile field of type 'date' is defined,
a) it is not possible to reverse from 'default to today' once selected and saved
b) whatever the default is, the selectable date range goes from TODAY to exactly 100 years ago - so one has no way to select a date in the future.
For b), I found a solution by hacking includes/functions_profile_fields.php , in line 669 the code has to be patched to allow a broader selection of the year.

Comments / History

Posted by Kellanved (Former Team Member) on Nov 14th 2007, 11:56

b) is already fixed, as to a) : I don't get what the bug is. Could you explain a little more verbosely?

Posted by richey on Nov 14th 2007, 12:11

You can't select a year in the future as the routine just calculates 100 years back. 8-)

I fixed it myself by changing line 670 from

for ($i = $now['year'] - 100; $i <= $now['year']; $i++)

to

for ($i = $now['year'] - 100; $i <= $now['year']+5; $i++)

to allow selecting a date range that goes up to 5 years into the future.

Posted by Kellanved (Former Team Member) on Nov 14th 2007, 12:19

b) is already fixed in the CVS

a) is the thing where I don't see a bug.

Posted by richey on Nov 14th 2007, 12:43

Try to define a custom profile field of type 'date' and set it to 'always use current date'.

Now, don't ever get the idea of setting a user-defined date value or leaving it empty, because the ACP will NEVER let you switch back from 'always use current date'... 8-o

Posted by Kellanved (Former Team Member) on Nov 14th 2007, 12:47

Sorry, I don't see where the problem is.
Please post step by step what you do, what is supposed to happen and what actually happens.

Posted by richey on Nov 14th 2007, 13:14

I don't know how else to describe it. Should I ever decide to use the same field without a predefined setting to default date, I would have to delete it and all users would lose their settings so far.

The ACP doesn't allow reversing a custom profile field of type 'date' with switch 'Always the current date' set to 'Yes' back to 'No'. I just reproduced it. The ACP 'automatically' switches it back to 'yes' after a 1-2 seconds.

Posted by Kellanved (Former Team Member) on Nov 14th 2007, 14:26

Got it, thanks.

Assigned ticket to user "Kellanved"

Action performed by Kellanved (Former Team Member) on Nov 14th 2007, 14:34

Changed ticket status from "New" to "Fix in progress"

Action performed by Kellanved (Former Team Member) on Nov 14th 2007, 14:34

Linked ticket with changeset: r8236

Action performed by Kellanved (Former Team Member) on Nov 15th 2007, 19:54

Changed ticket status from "Fix in progress" to "Fix completed in CVS"

Action performed by Kellanved (Former Team Member) on Nov 15th 2007, 19:55

Posted by richey on Dec 21st 2007, 08:30

This bug was NOT fixed. In PHPBB3.0 Gold, selecting a future year is still not possible. :-/

Ticket details

Related SVN changesets