verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
93 stars 69 forks source link

renderOptions always empty #1850

Closed tonioseiler closed 2 months ago

tonioseiler commented 2 months ago

Describe the bug

In my custom template, I want to override a specific field type. For this, I pass render options into the rendered form:

Steps to reproduce

{% set renderOptions = {
                formNotificationRecipients: block.formNotificationRecipients
            } %}

            {{ craft.formie.renderForm(block.formieFormHandle, renderOptions) }}

In the fieled, my code looks like this:

{% if value is empty %}
        {% set mail = renderOptions.formNotificationRecipients ?? '' %}
    {% else %}
        {% set product = craft.entries.section('products').slug(value).one() %}
        {% if product %}
            {% set mail = product.formNotificationRecipients %}
        {% endif %}
    {% endif %}

    {{ fieldtag('fieldInput', {
        value: mail ?? false,
    }) }}

The field is always emty. When I prompt the renderOptions, its always an empty array.

Thanks

Form settings

Craft CMS version

Craft Pro 4.7.3

Plugin version

2.1.10

Multi-site?

Yes

Additional context

No response

engram-design commented 2 months ago

Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-4 as 2.1.12".

tonioseiler commented 2 months ago

Works perfect. Thank you!

––––––––––––––––––– Tonio Seiler Dipl. Ing. FH Informatik @.***

Furbo GmbH Rüdigerstrasse 10 8045 Zürich

+41 44 501 85 65 www.furbo.ch

Abwesenheit: Mittwochs

Am 25.04.2024 um 07:59 schrieb Josh Crawford @.***>:

Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-4 as 2.1.12".

— Reply to this email directly, view it on GitHub https://github.com/verbb/formie/issues/1850#issuecomment-2076428888, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCCV4Z2CXDLKN36OIXAY6LY7CLV3AVCNFSM6AAAAABGX2C45KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZWGQZDQOBYHA. You are receiving this because you authored the thread.

engram-design commented 2 months ago

Fixed in 2.1.13