Really love your module, I was looking for exactly this. I just made one change:
// I changed this...
if (count($options) == 1) {
$contents['quote-option']['#default_value'] = array_pop(array_keys($options));
}
// into this:
$contents['quote-option']['#default_value'] = count($options) == 1 ? array_pop(array_keys($options)) : key($options) ;
If there are multiple options, the first one will be selected. Otherwise, users would probably forget to check an option when there are multiple options.
Maybe you could put it like this in the module.
Comments
Comment #1
longwaveThis was originally by design, so the user was forced to choose if there was more than one option available. Perhaps it could be added as a setting in the module at some point.