Bug tracker

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

Numeric type Custom Profile Fields with no default value return zero (fix completed in vcs)

I've created a numeric field, 4 characters long, accepting values from 1950 to 2008. I left blank the default value in order to keep it hidden if someone has not filled it in. I noticed that in the registration form and in the UCP the field appeared with a zero as a default value and what's more, it was accepting zero as a valid number. Even when I set the default field value to zero, phpBB continued to accept 0 as a logical value. I changed the default value to -1 so that a user will have to type it in or erase it. But even in this scenario 0 was an acceptable value.

I believe here we face three bugs:
  1. The default numeric value can't be blank
  2. The default numeric value can be out of the range and improper length
  3. 0 (zero) is always an acceptable value

Comments / History

Linked ticket with changeset: r9788

Action performed by ToonArmy (Development Team Member) on Jul 19th 2009, 00:20

Changed ticket status from "New" to "Fix completed in SVN"

Action performed by ToonArmy (Development Team Member) on Jul 19th 2009, 00:20

Posted by Handyman` (QA Team) on Sep 26th 2009, 18:01

This one is not yet fixed.
As mentioned in the bug report, I set the default value to blank.

When I went to register, the default value in the field was already 0 - when I clicked submit on the registration page, it came back that 0 was below the required value - that part is correct.
If I deleted the 0 and clicked submit, my account was registered and after going to my profile, it shows as 0 even though I put in no value and 0 is below the 1950 minimum value.

Changed ticket status from "Fix completed in SVN" to "New"

Action performed by Acyd Burn (Server Manager) on Sep 30th 2009, 07:05

Linked ticket with changeset: r10216

Action performed by ToonArmy (Development Team Member) on Oct 7th 2009, 14:54

Changed ticket status from "New" to "Fix completed in SVN"

Action performed by ToonArmy (Development Team Member) on Oct 7th 2009, 14:54

Posted by ToonArmy (Development Team Member) on Oct 7th 2009, 14:55

Francis could you give it another test. Apparently this was still broken when creating the field, editing worked. The behaviour of required/non-required fields and the handling of 0/null should be fixed as well now.

Ticket details

Related SVN changesets