Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-9502

Disabled custom profile field causes SQl error on registration.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Duplicate
    • None
    • None
    • None
    • Linux, MySQL5

    Description

      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;
      
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: