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

Custom profile manager should not suppress errors when inserting user rows

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.1.0-b4
    • 3.1.0-RC4
    • None
    • None

    Description

      		$sql = 'UPDATE ' . $this->fields_data_table . '
      			SET ' . $this->db->sql_build_array('UPDATE', $cp_data) . '
      			WHERE user_id = ' . (int) $user_id;
      		$this->db->sql_query($sql);
       
      		if (!$this->db->sql_affectedrows())
      		{
      			$cp_data = $this->build_insert_sql_array($cp_data);
      			$cp_data['user_id'] = (int) $user_id;
       
      			$this->db->sql_return_on_error(true);
       
      			$sql = 'INSERT INTO ' . $this->fields_data_table . ' ' . $this->db->sql_build_array('INSERT', $cp_data);
      			$this->db->sql_query($sql);
       
      			$this->db->sql_return_on_error(false);
      		}

      The "return on error" was added before we had PHPBB3-12570 to prevent errors when adding rows a second time.
      Since sql_affectedrows() works correctly now, the sql_return_on_error() calls should be removed.

      Attachments

        Issue Links

          Activity

            People

              bantu Andreas Fischer [X] (Inactive)
              nickvergessen Joas Schilling
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: