On a site for a client we need to disable the locale module. Because some content was saved as language 'en' previously, disabling locale does not reset content and field database tables language field to 'und' or LANGUAGE_NONE. After disabling the module any nodes or fields that have been saved as 'en' are not displayed.
to fix this I created a module to update the entire database.
$schema = drupal_get_schema();
foreach($schema as $table =>$structure){
if(isset($structure['fields']) && isset($structure['fields']['language'])){
set_time_limit(0);
db_update($table)
->fields(array('language' => 'und'))
->condition('language','en')
->execute();
}
}
This code does not update the language field and i'm not sure why. Is it because the language field is an index?
also this should be incorporated into the locale module uninstall function to avoid other sites breaking in future.
Any help is appreciated
Comments
Comment #1
HyperGlide CreditAttribution: HyperGlide commentedWe had a similar issue any solutions?
Comment #2
HyperGlide CreditAttribution: HyperGlide commentedLooking for help please.
Comment #3
gfarishyan CreditAttribution: gfarishyan commentedFirst check that all content types does not depend on local module.
Loop over all node and set language to LANGUAGE_NONE.
Check that no dependencies on local module.
After you can disable local module.
Comment #4
HyperGlide CreditAttribution: HyperGlide commented@gfarishyan Thanks for the reply.
There are no dependencies on the module, it can be disabled and uninstalled. How that still leave the problem at hand seems to be what to do with the content / data that is already created. That is x number of nids of content with y number of vids vids of revisions.
Changing the setting in admin/structure/types/manage/CONTENT-TYPE would only effect new content yet to be created.
The module referenced in the original post was meant to update the DB so that all content is set to an undefined language type.
Any other ideas or suggestions?
Comment #5
hey_germanoSame issue here. Enabled Locale by mistake and now I can't disable it without breaking all the content that was created while it was on.
Has anybody figured out a solution?
Comment #6
rudolfbykerHere is my manual solution: http://drupal.stackexchange.com/questions/90370/disable-locale-module-br... Tested with Drupal 7.26.
Maybe this should be a feature in the locale module, but it's definitely not a bug. Also, please read https://drupal.org/node/45111