Skip to content

Commit 7b37b41

Browse files
committed
FIX: handle data arrays in wizard field interpolation
1 parent 6c15cf2 commit 7b37b41

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/custom_wizard/mapper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ def interpolate(string, opts = { user: true, wizard: true, value: true, template
238238

239239
def recurse(data, keys)
240240
return nil if data.nil?
241+
data = data.first if data.is_a?(Array)
241242
k = keys.shift
242243
result = data[k]
243244

plugin.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22
# name: discourse-custom-wizard
33
# about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more.
4-
# version: 2.11.6
4+
# version: 2.11.7
55
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Marcos Gutierrez
66
# url: https://github.com/paviliondev/discourse-custom-wizard
77
# contact_emails: [email protected]

0 commit comments

Comments
 (0)