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.
The comment is always created with the content language, even if locale is disabled. In this situation it should have language neutral instead like node.
Comment | File | Size | Author |
---|---|---|---|
#7 | language_comments_bug-624290-7.patch | 2.07 KB | peximo |
#1 | language_comments_bug-624290-1.patch | 2.1 KB | peximo |
Comments
Comment #1
peximo CreditAttribution: peximo commentedTo avoid this behavior we need to set default comment language to language neutral without locale enabled, like node, and set this to content language via locale module.
Comment #2
plachlet's test this
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedWould it work to simplify the last line:
BEFORE:
$form['language']['#value'] = empty($form['language']['#value']) ? $language->language : $form['language']['#value'];
AFTER:
$form['language']['#default_value'] = $language->language
Comment #4
peximo CreditAttribution: peximo commentedThe form element type 'value' (and $form['language'] is a 'value' type) doesn't have a property 'default_value', so $form['language']['#default_value'] doesn't work.
Comment #5
moshe weitzman CreditAttribution: moshe weitzman commentedComment #6
plachWhat about the following?
(We might avoid an unecessary function call)
This review is powered by Dreditor.
Comment #7
peximo CreditAttribution: peximo commentedFixed with plach suggestion.
Comment #8
plachlooks good!
Comment #9
Dries CreditAttribution: Dries commentedIt seems like both the current approach, and the approach taken by this patch make assumptions about the language of a comment.
Reality is that both are potentially flawed. Admittedly, the approach taken in this patch is probably less flawed because the assumption seems better.
On my personal blog, which is written in English, the assumption would still fail -- my posts are always in English, but people sometimes reply in Dutch because they know I speak Dutch.
PS: Mollom has an API that can be used to identify the language a piece of content is written in. Maybe the Mollom module for Drupal 7 needs to be extended to set the actual language, instead of a language that has been guessed based on the context.
Comment #10
peximo CreditAttribution: peximo commentedHi, I fully agree that both approaches make assumptions about language. But the previous approach is IMO also incorrect because without locale all content (nodes, comments...) must be language neutral.
I have also changed #605630: Comment language administration UI to make explicit this assumption allowing user with proper permissions to select the comment language.
This whould be a great solution.
Comment #11
webchickDries, it's not clear to me your concerns with this patch? Should I commit it, or did you want some adjustments made?
Comment #12
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD.