Uploaded image for project: 'eZ Platform Enterprise Edition'
  1. eZ Platform Enterprise Edition
  2. EZEE-3363

Block validators configuration is ignored

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: High High
    • None
    • 3.2.1
    • Page Builder
    • None

    Description

      Block configuration can be defined this way:

      banner:
          attributes:
              contentId:
                  name: Content
                  type: embed
                  validators:
                      content_type:
                          message: You must select Something
                          options:
                              types: something
                      regexp:
                          options:
                              pattern: '/[0-9]+/'
                          message: Choose Something

      Well, that is the theory, I just fought the system for 1 hour looking for the listener that was overriding my config.

      It turns out it is not a listener but simply the UDW config

       

      system:
          default:
              universal_discovery_widget_module:
                  configuration:
                      block_banner:
                          multiple: false
                          allowed_content_types: ['image']
                      block_gallery:
                          multiple: false
                          containers_only: true
                      block_content_list:
                          multiple: false
                          containers_only: true
                      embed_video:
                          multiple: false 

       

      This is bad for 2 reasons:

      • my config is purely ignored
      • if I add another embed in Banner, (let's say Background) as embed it will also be ignored and goes to the UDW config,

       

      because of this

      {% block block_configuration_attribute_embed_widget %}
          {% set attr = attr|merge({'hidden': true}) %}
          {{ form_widget(form, {'attr': attr})}}
          <div class="ez-block-embed-field">
              {% include '@EzPlatformPageBuilder/page_builder/block/config/embed_button.html.twig' with {
                  udw_config_name: 'block_banner',
                  data_open_udw: 'data-open-udw-embed'
              } %}
              {% include '@EzPlatformPageBuilder/page_builder/block/config/embed_preview.html.twig' %}
          </div>
      {% endblock %} 

      In ezplatform/vendor/ezsystems/ezplatform-page-builder/src/bundle/Resources/views/page_builder/block/config/banner.html.twig

       

      I don't think the `allowed_content_types` should be set in the default config

      Attachments

        Activity

          People

            Unassigned Unassigned
            2bfcc1b1-0b8e-4fb5-9c24-c434957abb69@accounts.ibexa.co Sébastien Morel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: