Révision 64156087
Ajouté par Assos Assos il y a plus de 7 ans
drupal7/sites/all/modules/panels/panels.install | ||
---|---|---|
1 | 1 |
<?php |
2 | 2 |
|
3 |
/** |
|
4 |
* @file |
|
5 |
*/ |
|
6 |
|
|
3 | 7 |
/** |
4 | 8 |
* Test requirements for installation and running. |
5 | 9 |
*/ |
... | ... | |
81 | 85 |
); |
82 | 86 |
|
83 | 87 |
return $schema; |
84 |
}
|
|
88 |
} |
|
85 | 89 |
|
86 | 90 |
function panels_schema_8() { |
87 | 91 |
$schema = panels_schema_7(); |
... | ... | |
308 | 312 |
), |
309 | 313 |
'primary key' => array('pid'), |
310 | 314 |
'indexes' => array( |
311 |
'did_idx' => array('did') |
|
315 |
'did_idx' => array('did'),
|
|
312 | 316 |
), |
313 | 317 |
); |
314 | 318 |
|
... | ... | |
445 | 449 |
*/ |
446 | 450 |
function panels_update_7301() { |
447 | 451 |
// Load the schema. |
448 |
|
|
449 | 452 |
// Due to a previous failure, the field may already exist: |
450 |
|
|
451 | 453 |
$schema = panels_schema_4(); |
452 | 454 |
$table = 'panels_pane'; |
453 | 455 |
$field = 'locks'; |
... | ... | |
627 | 629 |
} |
628 | 630 |
|
629 | 631 |
if (!empty($page_manager_panels)) { |
630 |
// Check panels displays that only have empty storage types |
|
632 |
// Check panels displays that only have empty storage types.
|
|
631 | 633 |
$result = db_query("SELECT pd.did FROM {panels_display} pd WHERE pd.did IN (:dids) AND storage_type = ''", array(':dids' => array_keys($page_manager_panels))); |
632 | 634 |
foreach ($result as $row) { |
633 | 635 |
db_update('panels_display') |
... | ... | |
652 | 654 |
db_create_table($table_name, $schema[$table_name]); |
653 | 655 |
} |
654 | 656 |
|
655 |
// Read existing allowed settings and store them in a new table. |
|
656 |
$variables = db_select('variable', 'v') |
|
657 |
->fields('v', array('name')) |
|
658 |
->condition('name', '%' . db_like('_allowed_types'), 'LIKE') |
|
659 |
->execute() |
|
660 |
->fetchCol(); |
|
661 |
foreach ($variables as $name) { |
|
662 |
$module = str_replace('_allowed_types', '', $name); |
|
663 |
$variable = variable_get($name); |
|
664 |
foreach ($variable as $type => $allowed) { |
|
665 |
$allowed = empty($allowed) ? 0 : 1; |
|
666 |
db_merge('panels_allowed_types') |
|
667 |
->key(array('module' => $module, 'type' => $type)) |
|
668 |
->fields(array( |
|
669 |
'module' => $module, |
|
670 |
'type' => $type, |
|
671 |
'allowed' => $allowed, |
|
672 |
)) |
|
673 |
->execute(); |
|
674 |
} |
|
675 |
variable_del($name); |
|
676 |
} |
|
657 |
/* |
|
658 |
The version of this update hook in release 3.8 included code that |
|
659 |
converted storage of allowed_types configuration from variables to the new |
|
660 |
table, and also deleted existing allowed_types configuration variables. |
|
661 |
See https://www.drupal.org/node/2479879. |
|
662 |
|
|
663 |
In order to prevent data loss on sites that had not yet updated to 3.8, the |
|
664 |
conversion and variable-deletion code has been removed from this update hook. |
|
665 |
*/ |
|
677 | 666 |
} |
678 | 667 |
|
679 | 668 |
/** |
Formats disponibles : Unified diff
Weekly update of contrib modules