Problem
Mollie's transport form template (Resources/views/Form/fields.html.twig) renders the parent form's synchronizationSettings field without checking whether it has already been rendered:
{% if (form.parent.synchronizationSettings is defined) %}
{{ form_widget(form.parent.synchronizationSettings) }}
{% endif %}
Oro's update.html.twig conditionally renders synchronizationSettings as a separate data block when form.synchronizationSettings.count > 0:
{% if (form.synchronizationSettings is defined and form.synchronizationSettings.count) %}
{% set dataBlocks = dataBlocks|merge([{...
'data': [form_widget(form.synchronizationSettings)] {# render #1 #}
}]) %}
{% endif %}
Later, form_widget(form) triggers the transport widget block, which calls Mollie's template — rendering the same field a second time. This produces:
Field "synchronizationSettings" has already been rendered, save the result of
previous render call to a variable and output that instead.
This is a latent bug in all Mollie versions — it was masked because the only two synchronization_settings fields (isTwoWaySyncEnabled, syncPriority) are gated by an applicable restriction that filters them out for Mollie integrations, keeping .count at 0 and skipping the data block entirely.
A recent Oro 6.1.x patch release added a logWarnings checkbox without an applicable restriction:
# oro/platform IntegrationBundle/Resources/config/oro/integrations.yml
logWarnings:
type: Symfony\Component\Form\Extension\Core\Type\CheckboxType
options:
label: oro.integration.integration.log_warnings.label
required: false
This makes .count = 1 for all integration types, including Mollie — triggering the double render.
Oro's own IntegrationBundle/Resources/views/Form/fields.html.twig already guards against this with a .rendered check:
{% if (form.synchronizationSettings is defined and not form.synchronizationSettings.rendered) %}
Reproduction
- Install OroCommerce 6.1.x (with the
logWarnings sync setting present)
- Install
mollie/orocommerce 6.1.0
- Navigate to Admin → System → Integrations → Manage Integrations
- Create or edit a Mollie integration
- Observe the Twig error about
synchronizationSettings being rendered twice
Suggested Fix
Add a .rendered check to Mollie's template, matching Oro's own pattern:
- {% if (form.parent.synchronizationSettings is defined) %}
+ {% if (form.parent.synchronizationSettings is defined and not form.parent.synchronizationSettings.rendered) %}
{{ form_widget(form.parent.synchronizationSettings) }}
{% endif %}
Environment
- mollie/orocommerce: 6.1.0 (latent in all versions)
- Surfaces on OroCommerce 6.1.x patch releases that include the
logWarnings sync setting
Problem
Mollie's transport form template (
Resources/views/Form/fields.html.twig) renders the parent form'ssynchronizationSettingsfield without checking whether it has already been rendered:{% if (form.parent.synchronizationSettings is defined) %} {{ form_widget(form.parent.synchronizationSettings) }} {% endif %}Oro's
update.html.twigconditionally renderssynchronizationSettingsas a separate data block whenform.synchronizationSettings.count > 0:{% if (form.synchronizationSettings is defined and form.synchronizationSettings.count) %} {% set dataBlocks = dataBlocks|merge([{... 'data': [form_widget(form.synchronizationSettings)] {# render #1 #} }]) %} {% endif %}Later,
form_widget(form)triggers the transport widget block, which calls Mollie's template — rendering the same field a second time. This produces:This is a latent bug in all Mollie versions — it was masked because the only two
synchronization_settingsfields (isTwoWaySyncEnabled,syncPriority) are gated by anapplicablerestriction that filters them out for Mollie integrations, keeping.countat 0 and skipping the data block entirely.A recent Oro 6.1.x patch release added a
logWarningscheckbox without anapplicablerestriction:This makes
.count = 1for all integration types, including Mollie — triggering the double render.Oro's own
IntegrationBundle/Resources/views/Form/fields.html.twigalready guards against this with a.renderedcheck:{% if (form.synchronizationSettings is defined and not form.synchronizationSettings.rendered) %}Reproduction
logWarningssync setting present)mollie/orocommerce6.1.0synchronizationSettingsbeing rendered twiceSuggested Fix
Add a
.renderedcheck to Mollie's template, matching Oro's own pattern:Environment
logWarningssync setting