Fix caching of multi-custom options
authorColeman Watts <coleman@civicrm.org>
Sat, 20 Jun 2015 18:06:22 +0000 (14:06 -0400)
committerColeman Watts <coleman@civicrm.org>
Sat, 20 Jun 2015 18:06:22 +0000 (14:06 -0400)
js/jquery/jquery.crmeditable.js

index 2b0908fd1d8936ac16ed38a3a7201dd8248b5024..c0134c79d107663d0edd1f70e4b7b59413983538 100644 (file)
           }
           var result,
             info = $i.crmEditableEntity(),
-            hash = info.entity + '.' + info.field,
+            // Strip extra id from multivalued custom fields
+            custom = info.field.match(/(custom_\d+)_\d+/),
+            field = custom ? custom[1] : info.field,
+            hash = info.entity + '.' + field,
             params = {
-              field: info.field,
+              field: field,
               context: 'create'
             };
           $i.data('optionsHashKey', hash);