Facet API : How to change some behaviors like having input radio instead of checkbox I need to change some default behavior from the facet API.

I am searching for documentation about the hook from the Facet API module, but I have not found anything for now, except a very good tutorial about Apache Solr and Facet API.

I downloaded the Facet API bonus module because I thought it would help me.

There are some very good features like Rewrite facet items via callback function, but it seems it only works for the markup; I can't change the input.

function custom_facet_facet_items_alter(&amp;$build, &amp;$settings) {
  dsm($build);
  dsm($settings);
  if ($settings-&gt;facet == "field_produit_dev_durable") {
    foreach($build as $key =&gt; $item) {
      $build[$key]["#markup"] = drupal_strtoupper($item["#markup"]);
    }
  }
}


I tried to use the Devel modutle o see the content of the variables build, and setting, but there is nothing interesting for me.





So I need two things


Understand how to change the checkbox input
Understand how to remove the count number aside the Yes or No 


I made my module and use this, but weirdly it doesn't remove the number.

$build[$key]["#markup"] = drupal_strtoupper($item["#markup"]);


I used the fist tutorial I linked at the beginning of my post, but I found a problem I don't understand.

When I used my code on two different facets I got an error:


  An illegal choice has been detected. Please contact the site administrator.


My code is the same code shown in this article, but I replace the select field with a radio field. I think there is a conflict between the two form, when I validate.
What you're doing to change the markup should just work, here's a working example I have from a project that does just that:

function foo_facet_items_alter(&amp;$build, &amp;$settings) {
  if ($settings-&gt;facet === 'my_facet') {
    foreach($build as $key =&gt; $item) {
      $build[$key]["#markup"] = drupal_ucfirst($item["#markup"]);
    }
  }
}


I can confirm that it works as expected.

As far as switching the select for a radio, the error you get is pretty common and you're probably not removing/adding extra Form API options that aren't allowed for one of the types.

Radio buttons behave a bit different than selects, you might not be able to just switch the #type and have it work, if this is still relevant, please post the code you're using to alter that form... thanks!