Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bracket syntax for replacing setting workflow settings with record values uses caption instead of alias #35

Closed
TimGeyssens opened this issue Oct 17, 2018 · 8 comments

Comments

@TimGeyssens
Copy link

This causes issues when you have 2 (or more) fields with the same name... you can never access the first value...

@nul800sebastiaan
Copy link
Member

Hey Tim, I am not sure how this works, can you give a few steps to reproduce the issue please?

@TimGeyssens
Copy link
Author

hey, there is a support call with all the details, let my find it and copy some steps

@TimGeyssens
Copy link
Author

support call 38700, Add a new form, create 2 fields with the same name (email type and email as name), update the email workflow to send to {email} instead of a harcoded address... fill in the form, it now send to the second email filled in, and you can't access the first email field with the special syntax

@TimGeyssens
Copy link
Author

@nul800sebastiaan does it make sense? if you need more info let me know

@hfloyd
Copy link

hfloyd commented Mar 14, 2019

I think this is the same as the issue mentioned here on the old tracker:
https://issues.umbraco.org/issue/CON-1208#tab=Comments

This is still a problem in Version 7.0.6.

For example, given two form fields:
FormFields

Ideally (and logically), one would use the field ALIAS as the "merge value":
Email-DoesntWork

However, this results in blank values in the resulting email message. (Neither casing as the Alias is cased nor making it all lowercase works.)

Based on the previously mentioned issue as well as this forum post: https://our.umbraco.com/forum/umbraco-forms/92172-unable-to-get-field-values-in-email-subject

I was clued into using the caption/field name instead.

However, using it as-is DOES NOT WORK (it prevents the email from sending at all):
DoesntWorkDoesntSubmit

You need to remove the spaces for it to work:
ThisWorks

This format (even with the question mark included) DOES cause the email to send with the expected values.
image

This is really not intuitive at all, and as previously mentioned, if you have two fields with the same user-visible names, you cannot target the specific field desired. Generally aliases are understood to be unique on a single form, so using the alias would allow for accurate targeting.

Also, it means that any changes to the user-visible wording for a field (certainly not unheard of!) will break any merge references.

I can understand that correcting an error of this type could create a breaking change - after all, developers have likely figured out how to set up their merge references using the caption. My suggestion would be to use a check in the merging code along the lines of

if (bracketedmergefield matches an alias of a formfield)
{ merge in field value}
else if (bracketedmergefield matches a caption of a formfield)
{ merge in field value}
else {blank}

I know there is still the slight possibility that someone might have an alias and a caption on the same form that match, but are assigned to different fields... but I really think this should be changed anyway - and mentioned in the release notes.

At the least, I hope this fix makes it into Version 8 immediately, since that is so new, you don't need to worry about legacy forms.

@TimGeyssens
Copy link
Author

Had a support call a while back and they said it wasn't a priority and that it would break existing workflows (offered a couple of solutions but didn't get a response back...)

@hfloyd
Copy link

hfloyd commented Mar 21, 2019

Hi @TimGeyssens , Yeah, I got that impression... It would be nice if this could at least get resolved for the V8 version... Even if there was a config value or something... <mergesource>caption/alias</mergesource> because it is just icky as-is... and can really cause issues for larger or more complex forms.

@nul800sebastiaan
Copy link
Member

This issue is duplicated in #120, we'll keep tracking it there ➡️ #120

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants