Révision 389fb945
Ajouté par Assos Assos il y a presque 5 ans
drupal7/sites/all/modules/webform/webform.install | ||
---|---|---|
645 | 645 |
'indexes' => array( |
646 | 646 |
'nid' => array('nid'), |
647 | 647 |
'sid_nid' => array('sid', 'nid'), |
648 |
// For all but MS SQL Server databases, 64-character index is created on the data column after the schema is installed. |
|
648 |
// For all but MS SQL Server databases, 64-character index is created on |
|
649 |
// the data column after the schema is installed. |
|
649 | 650 |
), |
650 | 651 |
); |
651 | 652 |
|
... | ... | |
796 | 797 |
variable_del('webform_default_format'); |
797 | 798 |
variable_del('webform_format_override'); |
798 | 799 |
variable_del('webform_email_select_max'); |
800 |
variable_del('webform_fieldset_wrap'); |
|
799 | 801 |
variable_del('webform_node_types_primary'); |
800 | 802 |
variable_del('webform_date_type'); |
801 | 803 |
variable_del('webform_export_format'); |
... | ... | |
1972 | 1974 |
} |
1973 | 1975 |
|
1974 | 1976 |
// Begin a transaction for updating the serial numbers. The transaction will |
1975 |
// commit when $txn is unset or goesout-of-scope.
|
|
1976 |
$txn = db_transaction();
|
|
1977 |
// commit when $transaction is unset or goes out-of-scope.
|
|
1978 |
$transaction = db_transaction();
|
|
1977 | 1979 |
|
1978 | 1980 |
// Delete stray entries from the Webform tables before adding serial numbers. |
1979 | 1981 |
db_query("DELETE FROM {webform_submissions} WHERE nid NOT IN (SELECT nid FROM {webform})"); |
... | ... | |
2009 | 2011 |
->execute(); |
2010 | 2012 |
} |
2011 | 2013 |
// Commit the transaction. |
2012 |
unset($txn);
|
|
2014 |
unset($transaction);
|
|
2013 | 2015 |
|
2014 | 2016 |
// Now that every submission has a serial number, make serial numbers required. |
2015 | 2017 |
$spec['not null'] = TRUE; |
... | ... | |
2060 | 2062 |
* causes no problem, this update removes the schema module's warning. |
2061 | 2063 |
*/ |
2062 | 2064 |
function webform_update_7418() { |
2063 |
// While there should never be any NULL values in the extra field, change them to '' to be safe. |
|
2065 |
// While there should never be any NULL values in the extra field, change them |
|
2066 |
// to '' to be safe. |
|
2064 | 2067 |
db_update('webform_emails') |
2065 | 2068 |
->fields(array('extra' => '')) |
2066 | 2069 |
->isNull('extra') |
2067 | 2070 |
->execute(); |
2068 |
// Pass a complete field specification to db_change_field for cross-database compatiblity. |
|
2071 |
// Pass a complete field specification to db_change_field for cross-database |
|
2072 |
// compatiblity. |
|
2069 | 2073 |
$spec = array( |
2070 | 2074 |
'description' => 'A serialized array of additional options for the e-mail configuration, including excluded components and value mapping for the TO and FROM addresses for select lists.', |
2071 | 2075 |
'type' => 'text', |
... | ... | |
2118 | 2122 |
} |
2119 | 2123 |
|
2120 | 2124 |
/** |
2121 |
* Convert conditionals to be able to support multiple actions per conditional. Backup your database before proceeding. WARNING: Sites with many, many conditionals should execute this update via drush to avoid a PHP timeout. |
|
2125 |
* Convert conditionals to be able to support multiple actions per conditional. |
|
2126 |
* |
|
2127 |
* Backup your database before proceeding. WARNING: Sites with many, many |
|
2128 |
* conditionals should execute this update via drush to avoid a PHP timeout. |
|
2122 | 2129 |
*/ |
2123 | 2130 |
function webform_update_7423() { |
2124 | 2131 |
// Create webform_condtional_actions table. |
... | ... | |
2183 | 2190 |
db_create_table('webform_conditional_actions', $schema['webform_conditional_actions']); |
2184 | 2191 |
} |
2185 | 2192 |
|
2186 |
// In a site with many, many conditionals, the db_insert may timeout. Start a transaction to ensure atomic action. |
|
2187 |
$tx = db_transaction(); |
|
2188 |
// Copy target information from existing webform_conditional table to new webfrom_condtional_actions table. |
|
2193 |
// In a site with many, many conditionals, the db_insert may timeout. Start a |
|
2194 |
// transaction to ensure atomic action. |
|
2195 |
$transaction = db_transaction(); |
|
2196 |
// Copy target information from existing webform_conditional table to new |
|
2197 |
// webfrom_condtional_actions table. |
|
2189 | 2198 |
$select = db_select('webform_conditional', 'c') |
2190 | 2199 |
->fields('c', array('nid', 'rgid', 'action', 'target_type', 'target')) |
2191 | 2200 |
->orderBy('nid')->orderBy('rgid'); |
... | ... | |
2195 | 2204 |
->execute(); |
2196 | 2205 |
|
2197 | 2206 |
// Commit the insert. |
2198 |
unset($tx);
|
|
2207 |
unset($transaction);
|
|
2199 | 2208 |
|
2200 | 2209 |
// Remove unneeded columns from webform_conditional. |
2201 | 2210 |
foreach (array('action', 'target_type', 'target') as $fieldname) { |
... | ... | |
2204 | 2213 |
} |
2205 | 2214 |
} |
2206 | 2215 |
|
2207 |
// Rebuild the registry because this point release contains a new class: WebformConditionals. |
|
2216 |
// Rebuild the registry because this point release contains a new class: |
|
2217 |
// WebformConditionals. |
|
2208 | 2218 |
registry_rebuild(); |
2209 | 2219 |
|
2210 | 2220 |
return t('Webform database tables were successfully adjusted to allow more than one action for each conditional.'); |
... | ... | |
2254 | 2264 |
} |
2255 | 2265 |
|
2256 | 2266 |
/** |
2257 |
* Add database columns for submission completed and modified timestamps. Sites with many submissions may wish to use drush to execute this update. |
|
2267 |
* Add database columns for submission completed and modified timestamps. |
|
2268 |
* |
|
2269 |
* Sites with many submissions may wish to use drush to execute this update. |
|
2258 | 2270 |
*/ |
2259 | 2271 |
function webform_update_7427() { |
2260 | 2272 |
// Create new timestamp columns. |
... | ... | |
2278 | 2290 |
} |
2279 | 2291 |
} |
2280 | 2292 |
|
2281 |
// In a site with many submissions, the db_update may timeout. Start a transaction to ensure atomic action. |
|
2282 |
$tx = db_transaction(); |
|
2293 |
// In a site with many submissions, the db_update may timeout. Start a |
|
2294 |
// transaction to ensure atomic action. |
|
2295 |
$transaction = db_transaction(); |
|
2283 | 2296 |
// Copy submitted to completed for non-draft submissions. |
2284 | 2297 |
db_update('webform_submissions') |
2285 | 2298 |
->expression('completed', 'submitted') |
2286 | 2299 |
->condition('is_draft', 0) |
2287 | 2300 |
->execute(); |
2288 | 2301 |
// Commit the update. |
2289 |
unset($tx);
|
|
2302 |
unset($transaction);
|
|
2290 | 2303 |
|
2291 | 2304 |
// Start another transaction. |
2292 |
$tx = db_transaction();
|
|
2305 |
$transaction = db_transaction();
|
|
2293 | 2306 |
db_update('webform_submissions') |
2294 | 2307 |
->expression('modified', 'submitted') |
2295 | 2308 |
->execute(); |
2296 | 2309 |
// Commit the update. |
2297 |
unset($tx);
|
|
2310 |
unset($transaction);
|
|
2298 | 2311 |
|
2299 | 2312 |
// Clear the views cache since to see the completed and modified views fields. |
2300 | 2313 |
cache_clear_all('*', 'cache_views', TRUE); |
... | ... | |
2322 | 2335 |
} |
2323 | 2336 |
|
2324 | 2337 |
/** |
2325 |
* Add a column to the submission table to store the page on which to resume a draft. Sites with many, many submissions may wish to execute this update with 'drush updatedb'. |
|
2338 |
* Add column highest_valid_page to webform_submissions table. |
|
2339 |
* |
|
2340 |
* Add a column to the submission table to store the page on which to resume a |
|
2341 |
* draft. Sites with many, many submissions may wish to execute this update with |
|
2342 |
* 'drush updatedb'. |
|
2326 | 2343 |
*/ |
2327 | 2344 |
function webform_update_7429() { |
2328 | 2345 |
// Add highest_valid_page column to webform_submissions. |
Formats disponibles : Unified diff
Weekly update of contrib modules