forked from localgovdrupal/localgov_core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
localgov_core.install
32 lines (27 loc) · 1.02 KB
/
localgov_core.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/**
* @file
* Update hook implementations.
*/
use Drupal\localgov_core\FieldRenameHelper;
/**
* Update Field names for localgov_core provided fields.
*
* Field mapping between existing and new names:
* field_email_address => localgov_email_address
* field_facebook => localgov_facebook
* field_phone => localgov_phone
* field_twitter => localgov_twitter.
*
* This change creates and updates Drupal config entities. Unless configuration
* is *exported* after this update, later calls to 'drush deploy' or similar
* will revert these changes.
*/
function localgov_core_update_8001(&$sandbox) {
// Update field_ types fields provided by localgov_core.
$field_names = ['email_address', 'facebook', 'phone', 'twitter'];
foreach ($field_names as $field_name_unprefixed) {
FieldRenameHelper::renameField('field_' . $field_name_unprefixed, 'localgov_' . $field_name_unprefixed, 'node');
}
return t('Please export your sites configuration! Config entities for localgov_core where updated.');
}