You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the most recent version of Formerly. I do not have Mailchimp set up.
When trying to add a new field to a form I get the error "Undefined index: mcVar" related to line 135 in Formerly_FormsController.php $question->mcVar = $postedQuestion['mcVar'];
This does not happen when initially creating a new form.
As a temporary work around I am changing that line to: $question->mcVar = (isset($postedQuestion->mcVar) ? $postedQuestion['mcVar'] : null);
The text was updated successfully, but these errors were encountered:
This is more complex than it seems - if you apply the above you will lose your existing Mailchimp Merge Tags info on save.
From what I can tell the 'mcVar' field needs to be present in the matrix block added via 'Add question' button. This in turn is via the 'question template' that's set in the javascript which comes from the 'forms/_edit.html' macros.
I've tweaked the code in there so that the 'Mailchimp Merge Tag' is no longer within the {% if question %} conditional and it seems all is well.
Line 41 onwards:
{% if question %}
<div class="field" id="questions-15-name-field">
<div class="heading">
<label for="questions-15-name">Email Tag
</label>
</div>
<div class="input ltr">
{{'{' ~ (question ? question.handle | replace({(emailPrefix) : ''})) ~ '}'}}
</div>
</div>
{% endif %}
{{ forms.textField({
label: 'Mailchimp Merge Tag',
id: "questions-#{id}-mcVar",
name: "questions[#{id}][mcVar]",
value: question ? question.mcVar,
errors: question ? question.getErrors('mcVar'),
instructions: "*required if this form is submitting to a mailchimp list. Must match Mailchimp merge tag exactly.",
}) }}
I am using the most recent version of Formerly. I do not have Mailchimp set up.
When trying to add a new field to a form I get the error "Undefined index: mcVar" related to line 135 in Formerly_FormsController.php
$question->mcVar = $postedQuestion['mcVar'];
This does not happen when initially creating a new form.
As a temporary work around I am changing that line to:
$question->mcVar = (isset($postedQuestion->mcVar) ? $postedQuestion['mcVar'] : null);
The text was updated successfully, but these errors were encountered: