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.
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">
</div>
</div>
<div class="field-item odd">
<div id="jquery_colorpicker_color_display_37">
</div>
</div>
<div class="field-item even">
<div id="jquery_colorpicker_color_display_37">
</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
Comment #1
plopescHello
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
Comment #2
FiNeX CreditAttribution: FiNeX commentedOk, thanks, I will follow the other thread. Thanks :-)
Comment #2.0
FiNeX CreditAttribution: FiNeX commentedadded