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'] .= '
';" 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.
Comments
Comment #2
deepak_123 CreditAttribution: deepak_123 as a volunteer commentedComment #3
deepak_123 CreditAttribution: deepak_123 as a volunteer commentedUploading patch.
Comment #4
Devaraj johnson CreditAttribution: Devaraj johnson as a volunteer and at Ameex-Drupal Geeks commentedComment #5
dltj CreditAttribution: dltj at Cherry Hill Company commentedConfirmed -- this patch fixes the same problem I was having with the field description appearing on the node view page.
Comment #6
karthikkumarbodu CreditAttribution: karthikkumarbodu at Axelerant commentedYes fix looks good and working as expected.
Comment #7
renatogHello guys.
I applied the patch and works good for me.
+RTBC
Comment #9
renatogCommitted to the dev branch.
Thank you very much for contributing.
Best,
Comment #11
super_romeo CreditAttribution: super_romeo commentedBut 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...