Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-9502

Disabled custom profile field causes SQl error on registration.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • None
    • None
    • Linux, MySQL5

      Bug has place if you have disabled integer custom profile field with empty default value.
      Error example:

      Incorrect integer value: '' for column 'pf_testnew' at row 1 [1366]

      Possible ways to fix it:
      1) Don't let user create such field
      2) in functions_profile_fields.php after (around line 880)

       
      			$cp_data['pf_' . $row['field_ident']] = (in_array($row['field_type'], array(FIELD_TEXT, FIELD_STRING))) ? $row['lang_default_value'] : $row['field_default_value'];
      

      add

       
      			// Small fix for int fields with empty default value
      			if($row['field_type'] == FIELD_INT && empty($cp_data['pf_' . $row['field_ident']]))
      				$cp_data['pf_' . $row['field_ident']] = 0;
      
      

            bantu Andreas Fischer [X] (Inactive)
            Alek$ Alek$ [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: