Problem/Motivation
In NodeViewsData::getViewsData(), $data['node_field_revision']['langcode']['help'] is set twice.
$data['node_field_revision']['langcode']['help'] = $this->t('The language the original content is in.');
$data['node_field_revision']['table']['wizard_id'] = 'node_field_revision';
$data['node_field_revision']['status']['filter']['label'] = $this->t('Published');
$data['node_field_revision']['langcode']['help'] = $this->t('The language of the content or translation.');
$data['node_field_revision']['link_to_revision'] = [
'field' => [
'title' => $this->t('Link to revision'),
'help' => $this->t('Provide a simple link to the revision.'),
'id' => 'node_revision_link',
'click sortable' => FALSE,
],
];
Proposed resolution
Remove one of the lines setting $data['node_field_revision']['langcode']['help'] .
Comments
Comment #2
pasqualleComment #3
marciaibanezComment #5
marciaibanezI removed the mentioned line and opened a MR, kindly review it :)
Comment #6
pasquallethank you
Comment #7
avpadernoComment #8
avpadernoComment #9
avpadernoComment #10
avpadernoThe help string left in the code ('The language of the content or translation.) doesn't make much sense: If I translate a node, the original node and the translation cannot use the same language.
The language the original content is in. makes more sense, even if I would write The original content language.
We should probably check which one was supposed to stay. This means finding in which issues those literal strings where introduced and see if the issue was supposed to remove one of the strings.
Comment #11
longwave'The language of the content or translation.' was originally added in #2320521: Follow-up: Node language views filters need label adjustments
'The language the original content is in.' was then separately added later in #2429447: Use data table as views base table, if available., but it wasn't spotted that the help text already existed.
Comment #12
Amrita05 commentedCommenting out line 227
// $data['node_field_revision']['langcode']['help'] = $this->t('The language of the content or translation.');
Comment #13
avpaderno@longwave Thank you for looking up!
I take we should keep
'The language the original content is in.', or is there any reason for using the other string?Comment #14
avpadernoComment #15
shashwat purav commentedThe patch #14 applied successfully to 9.4.x branch.
Comment #17
asishsajeev commented#14 patch applied successfully.
Comment #18
longwave#14 looks fine to me.
We cannot write a test for this, as the duplicate array key is in the same method.
Comment #19
catchCommitted/pushed to 10.1.x and cherry-picked back through to 9.5.x, thanks!
Comment #21
asishsajeev commented