- Issue created by @MegaphoneJon
1.0 Problem/Motivation
When JS aggregation is enabled, sometimes `webform_civicrm_payments.js` loads before the `CRM` object is instantiated. This has probably escaped notice because we generally develop with JS aggregation disabled.
It appears to be this portion of the code:
if (typeof CRM.payment === 'undefined') {
CRM.payment = payment;
}
else {
$.extend(CRM.payment, payment);
}
2.0 Detailed steps to reproduce (embed screenshots)
I don't have sufficient details, other than that you must have payment enabled on your form and JS aggregation must be enabled.
3.0 Proposed resolution
I guess because core's `civicrm.libraries.yml` doesn't define the JS, there's no way to guarantee that this runs after the CRM object is created.
Active
6.3
Code