Project

General

Profile

Revision 7b2d1845

Added by Assos Assos almost 4 years ago

Weekly update of contrib modules

View differences:

drupal7/sites/all/modules/webform/webform.module
1113 1113
        'required' => FALSE,
1114 1114
        'conditional' => FALSE,
1115 1115
        'group' => TRUE,
1116
        'stores_data' => FALSE,
1116 1117
        'title_inline' => FALSE,
1117 1118
        'wrapper_classes' => FALSE,
1118 1119
      ),
......
1158 1159
        'email' => FALSE,
1159 1160
        'required' => FALSE,
1160 1161
        'conditional' => FALSE,
1162
        'stores_data' => FALSE,
1161 1163
        'title_display' => FALSE,
1162 1164
        'private' => FALSE,
1163 1165
        'wrapper_classes' => FALSE,
......
1186 1188
        'description' => FALSE,
1187 1189
        'private' => FALSE,
1188 1190
        'required' => FALSE,
1191
        'stores_data' => FALSE,
1189 1192
        'title_display' => FALSE,
1190 1193
        'wrapper_classes' => FALSE,
1191 1194
        'css_classes' => FALSE,
......
1324 1327
 * have been edited if necessary.
1325 1328
 */
1326 1329
function webform_webform_submission_presave($node, &$submission) {
1330
  module_load_include('inc', 'webform', 'includes/webform.components');
1327 1331
  // Check if there are any file components in this submission and if any of
1328 1332
  // them currently contain files.
1329 1333
  $has_file_components = FALSE;
......
5345 5349
/**
5346 5350
 * Returns the next serial number for a given node and increments it.
5347 5351
 *
5352
 * Return the serial number to be used in the next submission and saves the
5353
 * number after that as the subsequent serial number.
5354
 *
5348 5355
 * @param int $nid
5349 5356
 *   The nid of the node.
5350 5357
 *
......
5356 5363
  // the SELECT and the UPDATE, ensuring that multiple Webform submissions
5357 5364
  // at the same time do not have duplicate numbers. FOR UPDATE must be inside
5358 5365
  // a transaction. The return value of db_transaction() must be assigned or the
5359
  // transaction will commit immediately. The transaction will commit when $txn
5360
  // goes out-of-scope.
5366
  // transaction will commit immediately. The transaction will commit when
5367
  // $transaction goes out-of-scope.
5361 5368
  $transaction = db_transaction();
5362 5369

  
5363
  // Get the next_serial value.
5370
  // Get the value stored in this webform as the next_serial value.
5364 5371
  $next_serial = db_select('webform', 'w')
5365 5372
    // Only add FOR UPDATE when incrementing.
5366 5373
    ->forUpdate()
......
5369 5376
    ->execute()
5370 5377
    ->fetchField();
5371 5378

  
5372
  // $next_serial must be greater than any existing serial number.
5379
  // The value must be greater than $next_serial and any existing serial number.
5373 5380
  $next_serial = max($next_serial, _webform_submission_serial_next_value_used($nid));
5374 5381

  
5375
  // Increment the next_value.
5382
  // Store the value after $next_value for use in the subsequent submission.
5376 5383
  db_update('webform')
5377 5384
    ->fields(array('next_serial' => $next_serial + 1))
5378 5385
    ->condition('nid', $nid)

Also available in: Unified diff