Skip to content

synchronizationSettings double-render error when creating/editing integration on Oro 6.1.x #61

@Sebastian80

Description

@Sebastian80

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

  1. Install OroCommerce 6.1.x (with the logWarnings sync setting present)
  2. Install mollie/orocommerce 6.1.0
  3. Navigate to Admin → System → Integrations → Manage Integrations
  4. Create or edit a Mollie integration
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions