Error with Views image field with Formatter Splide Image

Created on 28 October 2023, about 1 year ago
Updated 14 December 2023, 12 months ago

After update from Splide 1.0.7/Blazy 8.x-2.16 to Splide 2.0.1/Blazy 8.x-2.21.

Views image fields with Formatter Splide Image or Splide File/SVG returns error

Warning: Undefined array key "items" in Drupal\views\Plugin\views\field\EntityField->getItems() (line 879 of core/modules/views/src/Plugin/views/field/EntityField.php)

💬 Support request
Status

Fixed

Version

2.0

Component

Miscellaneous

Created by

🇨🇾Cyprus akalyptos

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @akalyptos
  • Status changed to Postponed: needs info about 1 year ago
  • 🇮🇩Indonesia gausarts

    Thank you.

    Please detail:

    • Please paste the entire error message. You can re-access your errors at your Drupal admin watchdog pages under Reports menu, or server-side logs files.
    • Mind providing detailed reproduction steps? E.g. Create a Views Block, Add a field image, Select ....
    • Is it happening with the provided Splide samples?
  • 🇨🇾Cyprus akalyptos

    Create a demo on https://simplytest.me/ with projects Commerce Demo, Blazy and Splide.

    import this View configuration and check it

    Or use the demo I used if it's still active
    https://master-vsnyyhvsfhahic1rjlvk6zihlhviruma.tugboatqa.com/admin/stru...
    Change the Formatter to Split Image and the error will appear

    uuid: 847cc060-df69-4036-bb82-1e472c68495b
    langcode: en
    status: true
    dependencies:
      config:
        - field.storage.commerce_product_variation.field_images
        - image.style.catalog
      module:
        - blazy
        - commerce_product
    id: aa_test_001
    label: 'aa test 001'
    module: views
    description: ''
    tag: ''
    base_table: commerce_product_field_data
    base_field: product_id
    display:
      default:
        id: default
        display_title: Default
        display_plugin: default
        position: 0
        display_options:
          title: 'aa test 001'
          fields:
            title:
              id: title
              table: commerce_product_field_data
              field: title
              relationship: none
              group_type: group
              admin_label: ''
              entity_type: null
              entity_field: title
              plugin_id: field
              label: ''
              exclude: false
              alter:
                alter_text: false
                text: ''
                make_link: false
                path: ''
                absolute: false
                external: false
                replace_spaces: false
                path_case: none
                trim_whitespace: false
                alt: ''
                rel: ''
                link_class: ''
                prefix: ''
                suffix: ''
                target: ''
                nl2br: false
                max_length: 0
                word_boundary: true
                ellipsis: true
                more_link: false
                more_link_text: ''
                more_link_path: ''
                strip_tags: false
                trim: false
                preserve_tags: ''
                html: false
              element_type: ''
              element_class: ''
              element_label_type: ''
              element_label_class: ''
              element_label_colon: true
              element_wrapper_type: ''
              element_wrapper_class: ''
              element_default_classes: true
              empty: ''
              hide_empty: false
              empty_zero: false
              hide_alter_empty: true
              click_sort_column: value
              type: string
              settings: {  }
              group_column: value
              group_columns: {  }
              group_rows: true
              delta_limit: 0
              delta_offset: 0
              delta_reversed: false
              delta_first_last: false
              multi_type: separator
              separator: ', '
              field_api_classes: false
            field_images:
              id: field_images
              table: commerce_product_variation__field_images
              field: field_images
              relationship: variations_target_id
              group_type: group
              admin_label: ''
              plugin_id: field
              label: ''
              exclude: false
              alter:
                alter_text: false
                text: ''
                make_link: false
                path: ''
                absolute: false
                external: false
                replace_spaces: false
                path_case: none
                trim_whitespace: false
                alt: ''
                rel: ''
                link_class: ''
                prefix: ''
                suffix: ''
                target: ''
                nl2br: false
                max_length: 0
                word_boundary: true
                ellipsis: true
                more_link: false
                more_link_text: ''
                more_link_path: ''
                strip_tags: false
                trim: false
                preserve_tags: ''
                html: false
              element_type: ''
              element_class: ''
              element_label_type: ''
              element_label_class: ''
              element_label_colon: false
              element_wrapper_type: ''
              element_wrapper_class: ''
              element_default_classes: true
              empty: ''
              hide_empty: false
              empty_zero: false
              hide_alter_empty: true
              click_sort_column: target_id
              type: blazy
              settings:
                caption:
                  alt: '0'
                  title: '0'
                link: ''
                background: false
                box_caption: ''
                box_caption_custom: ''
                loading: ''
                preload: false
                box_style: ''
                image_style: catalog
                media_switch: ''
                ratio: ''
                thumbnail_style: ''
                grid: ''
                grid_medium: ''
                grid_small: ''
                style: ''
              group_column: ''
              group_columns: {  }
              group_rows: true
              delta_limit: 0
              delta_offset: 0
              delta_reversed: false
              delta_first_last: false
              multi_type: separator
              separator: ', '
              field_api_classes: false
          pager:
            type: none
            options:
              offset: 0
              items_per_page: null
          exposed_form:
            type: basic
            options:
              submit_button: Apply
              reset_button: false
              reset_button_label: Reset
              exposed_sorts_label: 'Sort by'
              expose_sort_order: true
              sort_asc_label: Asc
              sort_desc_label: Desc
          access:
            type: none
            options: {  }
          cache:
            type: tag
            options: {  }
          empty: {  }
          sorts: {  }
          arguments: {  }
          filters:
            status:
              id: status
              table: commerce_product_field_data
              field: status
              entity_type: commerce_product
              entity_field: status
              plugin_id: boolean
              value: '1'
              group: 1
              expose:
                operator: ''
                operator_limit_selection: false
                operator_list: {  }
            product_id:
              id: product_id
              table: commerce_product_field_data
              field: product_id
              relationship: none
              group_type: group
              admin_label: ''
              entity_type: commerce_product
              entity_field: product_id
              plugin_id: numeric
              operator: '='
              value:
                min: ''
                max: ''
                value: '1'
              group: 1
              exposed: false
              expose:
                operator_id: ''
                label: ''
                description: ''
                use_operator: false
                operator: ''
                operator_limit_selection: false
                operator_list: {  }
                identifier: ''
                required: false
                remember: false
                multiple: false
                remember_roles:
                  authenticated: authenticated
                min_placeholder: ''
                max_placeholder: ''
                placeholder: ''
              is_grouped: false
              group_info:
                label: ''
                description: ''
                identifier: ''
                optional: true
                widget: select
                multiple: false
                remember: false
                default_group: All
                default_group_multiple: {  }
                group_items: {  }
            variation_id:
              id: variation_id
              table: commerce_product_variation_field_data
              field: variation_id
              relationship: variations_target_id
              group_type: group
              admin_label: ''
              entity_type: commerce_product_variation
              entity_field: variation_id
              plugin_id: numeric
              operator: '='
              value:
                min: ''
                max: ''
                value: '1'
              group: 1
              exposed: false
              expose:
                operator_id: ''
                label: ''
                description: ''
                use_operator: false
                operator: ''
                operator_limit_selection: false
                operator_list: {  }
                identifier: ''
                required: false
                remember: false
                multiple: false
                remember_roles:
                  authenticated: authenticated
                min_placeholder: ''
                max_placeholder: ''
                placeholder: ''
              is_grouped: false
              group_info:
                label: ''
                description: ''
                identifier: ''
                optional: true
                widget: select
                multiple: false
                remember: false
                default_group: All
                default_group_multiple: {  }
                group_items: {  }
          style:
            type: default
          row:
            type: fields
          query:
            type: views_query
            options:
              query_comment: ''
              disable_sql_rewrite: false
              distinct: false
              replica: false
              query_tags: {  }
          relationships:
            variations_target_id:
              id: variations_target_id
              table: commerce_product__variations
              field: variations_target_id
              relationship: none
              group_type: group
              admin_label: 'Product variation'
              entity_type: commerce_product
              entity_field: variations
              plugin_id: standard
              required: true
          header: {  }
          footer: {  }
          display_extenders: {  }
        cache_metadata:
          max-age: -1
          contexts:
            - 'languages:language_content'
            - 'languages:language_interface'
          tags:
            - 'config:field.storage.commerce_product_variation.field_images'
      block_1:
        id: block_1
        display_title: Block
        display_plugin: block
        position: 1
        display_options:
          display_extenders: {  }
        cache_metadata:
          max-age: -1
          contexts:
            - 'languages:language_content'
            - 'languages:language_interface'
          tags:
            - 'config:field.storage.commerce_product_variation.field_images'
    
  • 🇮🇩Indonesia gausarts

    > Change the Formatter to Splide Image and the error will appear
    Got it. So the problem was when changing formatters?

    I've seen some error once, but not related to this issue AFAIK.

    Try reloading the page by pressing F5 or CMD + R, and see if you got the page back?

    I am away from laptop, let me know if you got your Views UI back?

    If yes, likely a temporary glitch I experience once.
    If no, might be a real bug.

  • Status changed to Active about 1 year ago
  • 🇨🇾Cyprus akalyptos

    Follow the steps of my previous post, the problem is with Splide module.
    In my previous post i exported the view configuration in a working condition.
    When you select the Splide Image formatter the view not returning any images and you get the error.

  • 🇮🇩Indonesia gausarts

    Ok, sure, but you haven't answered my last question:

    Is it happening with Splide samples?

    So that we can narrow down issues more.

  • Status changed to Fixed 12 months ago
  • 🇮🇩Indonesia gausarts

    I cannot reproduce it with Splide samples. 6 out of 8 use Image fields with Splide formatter.
    Switching from core Image to Splide formatter, and vice versa don't error.

    See also my previous replies.

    I would strongly recommend you starting out from the very basic Image fields with core node or media entities, not contrib stuffs like commerce_product_variation, etc. They might likely need some relationships setups, etc. This way you can narrow down the culprit.

    Feel free to re-open if still an issue, or if any reproducible steps with the mentioned core stuffs.
    Again be sure to install any modules samples, they are solid POC, then grow complex from there.

    Thank you.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024