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

HyperGlide’s picture

We had a similar issue any solutions?

HyperGlide’s picture

Priority: Major » Critical

Looking for help please.

gfarishyan’s picture

First 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.

HyperGlide’s picture

@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?

hey_germano’s picture

Same 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?

rudolfbyker’s picture

Version: 7.23 » 7.26
Category: Bug report » Feature request
Priority: Critical » Normal
Issue summary: View changes

Here 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

Version: 7.26 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.