groups/modules/commons/commons_bw/commons_bw.install
Marton Kiss c2acc71500 Upgrade Drupal Commons to 7.x-3.23
Apply the security fixes including:
- Drupal Core - Moderately Critical - Multiple Vulnerabilities - SA-CORE-2015-001
- SA-CONTRIB-2015-079 - Chaos tool suite (ctools) - Multiple vulnerabilities

The following patches were applied to 7.x-3.23 commons modules:
- patches/0001-utility-links-block-install-theme.patch
- patches/0002-events-page-refactor-to-pages-module.patch

Installation profile got a refactor of module installation, as groups_ modules
and l10n_updates deployed from an installation task to avoid memory
exhausted errors of the installation process.

Change-Id: I48481657124fdbbee84e1cbfec3a3a2b5f475c2c
2015-03-24 16:38:09 +01:00

46 lines
1.1 KiB
Plaintext

<?php
/**
* Add the Title field to all browsing widget-enabled content types.
* per http://drupal.org/node/1969088.
*/
function commons_bw_update_7301() {
module_enable(array('title'));
$revert = array(
'commons_bw' => array(
'field_base', 'field_instance',
),
);
features_revert($revert);
return array();
}
/**
* Make sure existing nodes titles are migrated to the title field.
* per http://drupal.org/node/1969088.
*/
function commons_bw_update_7302() {
foreach (node_type_get_types() as $node_type) {
// Set the title as "Replaced by title_field".
if (!title_field_replacement_enabled('node', $node_type->type, 'title')) {
title_field_replacement_toggle('node', $node_type->type, 'title');
}
// Migrate the titles to the title field.
title_field_replacement_batch_set('node', $node_type->type, 'title');
}
drupal_flush_all_caches();
}
/**
* Standardize browsing widget field weights.
*/
function commons_bw_update_7303() {
$revert = array(
'commons_bw' => array('field_instance'),
);
features_revert($revert);
return array();
}