Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
What are the steps required to reproduce the bug?
create a new forum post, on a multi-lingual forum site
What behaviour were you expecting?
The language for the new post would be the same as the current language selected.
What happened instead?
English was selected.
Patch:
diff -r1.1 /var/www/modules/locale/locale.module
273a274
> global $language;
277c278,280
< '#default_value' => (isset($form['#node']->language) ? $form['#node']->language : ''),
---
> # SB: use current language for new posts
> # http://drupal.org/node/311158
> '#default_value' => (!empty($form['#node']->language) ? $form['#node']->language : $language->language),
Comments