summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoshe Weitzman2011-03-15 02:40:53 (GMT)
committer Moshe Weitzman2011-03-15 02:40:53 (GMT)
commitcdd8d80e010bcbe614ecc400eb489a9dff7df4e8 (patch)
tree3dab875cf9712fbfa9a61e1a04b3931844e803f5
parent6108695a4bcacb1e7228d177772872393de0ff21 (diff)
#1060782 by moshe weitzman. Properly set default language for non english sites.
-rw-r--r--devel_generate/devel_generate.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/devel_generate/devel_generate.inc b/devel_generate/devel_generate.inc
index a417262..3351a00 100644
--- a/devel_generate/devel_generate.inc
+++ b/devel_generate/devel_generate.inc
@@ -160,7 +160,7 @@ function devel_generate_add_comments($node, $users, $max_comments, $title_length
default:
$comment->pid = 0;
}
-
+
// The subject column has a max character length of 64
// See bug: http://drupal.org/node/1024340
$comment->subject = substr(devel_create_greeking(mt_rand(2, $title_length), TRUE), 0, 63);
@@ -659,7 +659,6 @@ function devel_generate_content_pre_node(&$results) {
* array of options obtained from devel_generate_content_form.
*/
function devel_generate_content_add_node(&$results) {
- global $language;
$node = new stdClass();
$node->nid = NULL;
@@ -676,12 +675,13 @@ function devel_generate_content_add_node(&$results) {
if (!isset($results['time_range'])) {
$results['time_range'] = 0;
}
- if (isset($results['add_language']) && variable_get('language_content_type_' . $node->type, 0)) {
+ if (isset($results['add_language'])) {
$languages = array_keys($results['add_language']);
$node->language = $languages[array_rand($languages)];
}
else {
- $node->language = LANGUAGE_NONE;
+ $default = langage_default('language');
+ $node->language = $default == 'en' ? LANGUAGE_NONE : $default;
}
$node->created = REQUEST_TIME - mt_rand(0, $results['time_range']);