Hi!
When you set a CCK field with multiple values, only the last one is displayed. The HTML output display all the divs but all of them share the same ID.

Example:

  <div class="field-items">
    <div class="field-item even">
      <div id="jquery_colorpicker_color_display_37">
        &nbsp;
      </div>
    </div>
    <div class="field-item odd">
      <div id="jquery_colorpicker_color_display_37">
        &nbsp;
      </div>
    </div>
    <div class="field-item even">
      <div id="jquery_colorpicker_color_display_37">
        &nbsp;
      </div>
    </div>
  </div>

and the CSS is:

#jquery_colorpicker_color_display_37 {
    background-color: #50B54B;
}
#jquery_colorpicker_color_display_37 {
    background-color: #8A1D8A;
}
#jquery_colorpicker_color_display_37 {
    background-color: #FFAE00;
}

The fix is simple, just substitute $instance['id'] with $item['jquery_colorpicker'] in the jquery_colorpicker_field_formatter_view() function.

Comments

plopesc’s picture

Hello

Your issue is duplicated from #1149120: Multiple colored divs get same class.

The bug is fixed in the git repository, however, I'm not able to release a new version with several bugs fixed.

Please get the code form the git repository or check the patch provided in #1149120: Multiple colored divs get same class

Thanks for your interest in this module.

Regards

FiNeX’s picture

Status: Active » Closed (duplicate)

Ok, thanks, I will follow the other thread. Thanks :-)

FiNeX’s picture

Issue summary: View changes

added