On my users' profile pages, if you can edit a field and the field already contains a value, the field's label is duplicated. Example:

<div class="field field-name-field-user-about field-type-text-long field-label-above">
<div class="field-label">About me:&nbsp;</div>
<div class="field-items">
<div class="field-item even">
<div id="editablefields-field-user-about" class="editablefield-item">
<form class="editable-field" action="/?q=user/17" method="post" id="editablefields-form-profile2-6-field-user-about" accept-charset="UTF-8"><div>
<div class="field field-name-field-user-about field-type-text-long field-label-above">
<div class="field-label">About me:&nbsp;</div>
CommentFileSizeAuthor
#4 duplicate_field_label-1480440-4.patch623 bytesankur

Comments

rsgracey’s picture

I'm getting this doubling, too. No matter what the choices in the content type display, if the label is there are no labels, and if it's Inline or Above, there are two.

johnv’s picture

II have this problem, but not for all fields:
- a list field is OK
- a date fieldhas double label and further markup.

kriboogh’s picture

The problem is the label is displayed for each field using the display mode settings, but the markup of the field is a complete form render, thus duplicating the label. You need to disable the label for the form generation.

In editablefields.module inside hook_field_formatter_view you should set the label to hidden. (notice the added $display['label'] = 'hidden'; line)

    // Standard Field API integration: generate the form.
    // Inject the HTML form.
    $display['label'] = 'hidden';    
    $items = array(0 => array());
    return array(
      0 => drupal_get_form('editablefields_form__' . $entity_type . '__' . $id . '__' . $vid . '__' . $field['field_name'], $entity_type, $entity, $field, $instance, $langcode, $display),
    );
ankur’s picture

Status: Active » Needs review
StatusFileSize
new623 bytes

Here's a patch that does what kriboogh suggests in comment #3 above. Works for me.

Anonymous’s picture

Great, it works for me, as expected.

dags’s picture

Status: Needs review » Reviewed & tested by the community

Tested and works but I'm going to hold off on committing this for now while I investigate a couple other issues.

drupalok’s picture

how about commiting now?

Anonymous’s picture

Patch worked for me, thank you.

dags’s picture

And over a year later... Committed to 7.x-1.x! Thanks for the patch ankur.

I regret that I haven't had more time to maintain this module.. I'll try to give it some tender loving care over the next couple of weeks.

dags’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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