Make "Chain Select" mechanism robust against missing 'target' form field
authorOlaf Buddenhagen <antrik@digitalcourage.de>
Thu, 5 Mar 2015 23:43:18 +0000 (00:43 +0100)
committerOlaf Buddenhagen <antrik@digitalcourage.de>
Thu, 5 Mar 2015 23:43:18 +0000 (00:43 +0100)
commita3984622f10655af382c6c56050d5178a26683f2
treecc2a28f25a7223a765bf4177ad44e5f1305bc3b3
parentb7a900d9cf9923ceb1569683ec3e6f60f7f034e2
Make "Chain Select" mechanism robust against missing 'target' form field

If removeElement() was invoked on an element that is the 'target' of a
'chainSelect' (which can happen through a form hook in an extension),
the chainSelect handling code was subsequently erroring out.

Add checks to avoid that.

This is related to the CRM-15476 fixes in
8f9c3cbea992320f344d576c8a87c5bab318466c and
14b2ff1521a8c25e363b13723c2979f52ad1cd47 , which already fixed the
situation where the 'control' element is missing.
CRM/Core/Form.php