mod-build 3.6.52-beta.3 → 3.6.52-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -242,12 +242,14 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
242
242
  };
243
243
 
244
244
  return async function() {
245
- if (!templatesData.doNotUseDefaultFieldConfig && !templatesData.defaultConfigCompleted) {
246
- await getDefaultFormFieldConfig();
247
- }
248
-
249
- if (!templatesData.tcpaText && templatesData.primary_trade) {
250
- await fetchTcpaFromSitegenie();
245
+ if (Object.keys(siteData).length > 0) {
246
+ if (!templatesData.doNotUseDefaultFieldConfig && !templatesData.defaultConfigCompleted) {
247
+ await getDefaultFormFieldConfig();
248
+ }
249
+
250
+ if (!templatesData.tcpaText && templatesData.primary_trade) {
251
+ await fetchTcpaFromSitegenie();
252
+ }
251
253
  }
252
254
 
253
255
  return gulp.src([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "3.6.52-beta.3",
3
+ "version": "3.6.52-beta.5",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -137,21 +137,17 @@ modForm.mapProjectValue = function(trade) {
137
137
  */
138
138
  modForm.preprocessContractorFormData = function(formData, currentStep) {
139
139
  if (currentStep === 0) {
140
- var heapCookie = window.heap && window.heap.appid ? window.modUtils.getCookie('_hp2_id.' + window.heap.appid) : null,
140
+ var heapCookieData = modUtils.getHeapCookieData(),
141
141
  attributionKeys = modUtils.getSupportedTrackingParams();
142
142
 
143
143
  formData.primaryProjectClass = this.mapProjectValue(formData.primaryProjectClass);
144
144
 
145
- if (heapCookie) {
146
- var heapCookieData = JSON.parse(decodeURIComponent(heapCookie));
147
-
148
- // Check heap cookie for tracking params and append to form
149
- $.each(heapCookieData, function(name, value) {
150
- if (attributionKeys.indexOf(name) > -1) {
151
- formData[name] = value;
152
- }
153
- });
154
- }
145
+ // Check heap cookie for tracking params and append to form
146
+ $.each(heapCookieData, function(name, value) {
147
+ if (attributionKeys.indexOf(name) > -1) {
148
+ formData[name] = value;
149
+ }
150
+ });
155
151
 
156
152
  // Check Eloqua GUID cookie value and add it to formData
157
153
  var elqGUID = this.elqGetGuidCookieValue();