Created
April 14, 2014 08:04
-
-
Save ckng/10626186 to your computer and use it in GitHub Desktop.
Drupal 7: revert language column to "und" on locale uninstallation, this is not for site with multilanguage, only for site with unused/unconfigured locale
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Use this to identify possible table needs to be updated | |
// SELECT DISTINCT TABLE_NAME | |
// FROM INFORMATION_SCHEMA.COLUMNS | |
// WHERE COLUMN_NAME IN ('language') | |
// AND TABLE_SCHEMA='<YOUR_DATABASE>'; | |
// include other custom fields | |
$tables = array( | |
'node', | |
'url_alias', | |
'field_data_body', | |
'field_data_comment_body', | |
'field_revision_body', | |
'field_revision_comment_body', | |
); | |
foreach ($tables as $table) { | |
db_update($table) | |
->fields(array( | |
'language' => 'und', | |
)) | |
->execute(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment