I was attempting to use the color_field module in conjunction with commerce_fancy_image_attributes and the images work perfect however when I try to just use the RGB functionality it is losing the information as to what to set the background color etc in a blank div because bootstrap_form_element utilizes the filter_xss_admin function which strips out the data. The data that should be generated looks like so:

<div class="term-52"><div class="field field-name-field-color-hex field-type-color-field-rgb field-label-hidden"><div class="field-items"><div class="field-item even"><div class="color-swatch" style="background-color: #900000; width: 50px; height: 50px;"></div></div></div></div></div>

however it is giving me:

<div class="term-52"><div class="field field-name-field-color-hex field-type-color-field-rgb field-label-hidden"><div class="field-items"><div class="field-item even"><div class="color-swatch"></div></div></div></div></div>

According to what I was reading this filter should be used when it is user generated content that may or may not be safe and not used when it is data coming from the database or a module such as a form field generation.

Is there a way to get around this issue?

Comments

markhalliwell’s picture

Status: Active » Closed (works as designed)

There are only two places that filter_xss_admin() is used:

A form element title (which can be user generated):
http://drupal-bootstrap.org/api/bootstrap/templates%21system%21form-elem...

and

A form element description (which can also be user generated):
http://drupal-bootstrap.org/api/bootstrap/templates%21system%21form-elem...

---

I don't see how either of these affect or are the source the problem you are describing above. The markup that is being stripped out is inside the field content itself and has nothing to do with the title or description as far as I can tell. If anything, I would further say that this is a rather unique situation (as this isn't something that everyone will need) and you should override whatever template/theme function you need to in your sub-theme to get these modules working on your site.