groups/modules/commons/commons_bw/commons_bw.install
Marton Kiss 8ac59801be Refactor commons build process
Update commons modules to release 7.12, and move the codebase under
modules/commons instead of constant fetching from remote repository.
The commons.make file removed so it is not required to rebuild
groups distribution.

Change-Id: I3be393ba1af34427e2915b18ab1ad718fd4e54db
2014-05-28 15:58:33 +02:00

35 lines
904 B
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();
}