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.
Steps:
1. create a normal view with shows node content and select display format as show content instead of fields and then in the settings form you can see view mode option ,display links as per latest head. There should be Display comments check box here. it doesn't show no matter what, because of wrong access check in code.
Below is the code in the plugin file: modules/node/views_plugin_row_node_view.inc
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$options = $this->options_form_summary_options();
$form['view_mode'] = array(
'#type' => 'select',
'#options' => $options,
'#title' => t('View mode'),
'#default_value' => $this->options['view_mode'],
);
$form['links'] = array(
'#type' => 'checkbox',
'#title' => t('Display links'),
'#default_value' => $this->options['links'],
);
$form['comments'] = array(
'#type' => 'checkbox',
'#title' => t('Display comments'),
'#default_value' => $this->options['comments'],
'#access' => module_exists('comments'),
);
}
The last element has #access check for comments module, which actually should be "comment".
Comment | File | Size | Author |
---|---|---|---|
#6 | After.png | 122.46 KB | renatog |
#6 | Before.png | 115.29 KB | renatog |
#4 | evidence2.png | 20.57 KB | Algarte |
#4 | evidence1.png | 18.28 KB | Algarte |
#3 | display_comments_option-2887227-3.patch | 1.11 KB | sumanthkumarc |
|
Comments
Comment #2
sumanthkumarc CreditAttribution: sumanthkumarc at Azri Solutions commentedAdding patch.
Comment #3
sumanthkumarc CreditAttribution: sumanthkumarc at Azri Solutions commentedOops, found another place with the same machine name error :( adding that too. This is final patch with changes in both places.
Comment #4
Algarte CreditAttribution: Algarte at CI&T commentedI tested patch #3 and it worked fine. See attachment below with evidences.
Before :
After :
Comment #5
Algarte CreditAttribution: Algarte at CI&T commentedComment #6
renatogHi people.
I applied the patch #3 and Works good for me too.
+RTBC
Before
After
Regards
Comment #8
renatogFixed.
Good catch. Thank you very much for contributions @algarte and @sumanthkumarc.
Commited in dev branch.
Good Work.
Regards.
Comment #10
DamienMcKenna