If a HS field is required, and the user cancels adding a new term on the highest level term, the field validator is triggered. This results in a "field is required" message being displayed, and can happen an infinite amount of times resulting in numerous messages.

This creates a usability issue, as the form has not yet been submitted, and can be confusing for users that may have accidentally selected create new term.

Tested on vanilla Drupal with 7.x-3.x-dev. Modules enabled: hierarchical select, hierarchical select menu, and hierarchical select taxonomy views.

I will be looking into the issue further, but I would appreciate knowing if anyone has a solution already (besides making the field optional).

CommentFileSizeAuthor
#1 HS-7.x-3.x-dev issue 1321242.jpg37.82 KBAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rlangille’s picture

Update: This actually ends up submitting the whole form, and all required field messages are displayed above the HS field.

rlangille’s picture

Found a temporary work around until I have more time to look into this. Change line 327 of hierarchical_select.module from:

  $output = theme('status_messages') . drupal_render($form);

to:

  drupal_get_messages();
  $output = drupal_render($form);

The messages generated at this point should theoretically ONLY be validation issues for the form, and since they are validated again when the form is submitted I'm ok with this for now. However I have not tested it enough to be fully confident in it. As such, I will hold off on submitting a patch until I am sure.

RumpledElf’s picture

You also get this one when you've got a required multi-level HS and it is triggered just browsing through to a lower level before you even make a selection. By the time you've found something to select you've got a pagefull of error messages. Drives me nuts.

anilkhadka’s picture

I got the same issue in development version and alpha 5 version. I tried to fix it by using instruction as in comment #2. I am able to remove message but I also want to remove red border color around combo box because it gives false message to user(Actually I don't want to remove it from CSS because it creates problem in validation). Please help me to get rid of this problem. Thanks in advance.

ahwebd’s picture

@aniel : see this http://drupal.org/node/1389740

the module attached removes the red border (see line 222 in file "solve_hs_issues.module")

GuyPaddock’s picture

Status: Active » Closed (duplicate)