Skip to content

Commit

Permalink
Merge pull request #1411 from bgilhome-now/feature/1410-webform-mappi…
Browse files Browse the repository at this point in the history
…ng-support-name-attribute

Support 'name' attribute (if set) in webform mapping
  • Loading branch information
waitingallday authored Dec 16, 2024
2 parents 9ff95ac + c2e3fdc commit e65d674
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/ripple-tide-webform/mapping/webforms-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ export const getFormSchemaFromMapping = async (
const fields = []
const formId = webform.drupal_internal__id

for (const [fieldKey, fieldData] of Object.entries(elements)) {
for (const [fieldMachineName, fieldData] of Object.entries(elements)) {
let mappedField
const field: TideWebformElement = { ...fieldData, formId }
const fieldID = `${formId}_${fieldKey}`
const fieldID = `${formId}_${fieldMachineName}`
const fieldKey = field['#attributes']?.name || fieldMachineName

switch (field['#type']) {
case 'hidden':
Expand Down

0 comments on commit e65d674

Please sign in to comment.