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.
When level label is enabled, i think that there is no need for default label, also, if i may, < Please select > sounds much better if term is required so my suggestion is:
if (!$required || $enforce_deepest && !isset($level_labels[0]) || ($dropbox && count($dropbox->lineages) > 0)) {
$hierarchy->levels[0] = array('none' => '<'. t('Please select') .'>') + $hierarchy->levels[0];
}
Sorry I just don't have time now to learn how to create patch and this is just cosmetic change. I would like to have < Please select > labels on all levels not just rooth, when $enforce_deepest = TRUE. Is there some problem with that idea, for which i don't now or I can try to do it? Thanks and sorry about my English :)
Comments
Comment #1
Wim LeersThat would be a usability issue. You're enforcing the user to select something from the deepest level, but you're not enforcing it through the form element/widget itself.
The way I implemented it, it *is* enforced, and there's a clear distinction between having enforce_deepest disabled or enabled.
I've explained this before, if you want more detailed explanations, please search the issue queue.