I am still not sure if this is happening because of the custom code that i have written or this is a legitimate bug.

When i add a help text for a field collection on the content type manage fields interface, i see that help text on the node view page as well.

I found the code which is causing this.

File - field_collection.module, Line no. - 842 - 853

if (field_collection_item_access('create', $field_collection_item)) {
      $allow_create_item = TRUE;
      $path = field_collection_field_get_path($field);
      list($id) = entity_extract_ids($entity_type, $entity);
      $element['#suffix'] = '';
      if (!empty($settings['description'])) {
        $element['#suffix'] .= '<div class="description field-collection-description">' . field_filter_xss($instance['description']) . '</div>';
      }
      $title = entity_i18n_string("field:{$field['field_name']}:{$instance['bundle']}:setting_add", $settings['add']);
      $add_path = $path . '/add/' . $entity_type . '/' . $id;
      $element['#suffix'] .= '<ul class="action-links action-links-field-collection-add"><li>';
      $element['#suffix'] .= l($title, $add_path, array('query' => drupal_get_destination()));
      $element['#suffix'] .= '</li></ul>';
}

The line "$element['#suffix'] .= '

' . field_filter_xss($instance['description']) . '

';" prints out the help text on node view page as well, so it needs a check.

I have created a patch. Will upload it ASAP.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

deepak_123 created an issue. See original summary.

deepak_123’s picture

Issue summary: View changes
deepak_123’s picture

Devaraj johnson’s picture

Status: Active » Needs review
dltj’s picture

Confirmed -- this patch fixes the same problem I was having with the field description appearing on the node view page.

karthikkumarbodu’s picture

Status: Needs review » Reviewed & tested by the community

Yes fix looks good and working as expected.

renatog’s picture

Hello guys.

I applied the patch and works good for me.

+RTBC

  • RenatoG committed 89d3d7d on 7.x-1.x authored by deepak_123
    Issue #2688375 by deepak_123, Devaraj johnson, dltj, karthikkumarbodu,...
renatog’s picture

Status: Reviewed & tested by the community » Fixed

Committed to the dev branch.

Thank you very much for contributing.

Best,

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

super_romeo’s picture

But in description I wrote tutorial to user, why he should add the collection.
So what should I do now?
And setting "Show the field description beside the add link." has no effect...