0

I have built a normal view with a contextual filter on a taxonomy term:

enter image description here

This taxonomy term consists of 6 terms, with four terms the call of the view works without problems and with two terms I get the following error message:

TypeError: Unsupported operand types: string - int in __TwigTemplate_f8f1a2c97d1bdf992eb6d482520f02b8->doDisplay() (line 54 of /srv/www/stage-multisite/home/vendor/twig/twig/src/Environment.php(360) : eval()'d code).

What could be the problem?

Thank you and best regards

Bavra

      uuid: 80d91b4f-14a1-4f5d-b9b6-c22e4e050dc7
langcode: en
status: true
dependencies:
  config:
    - field.storage.taxonomy_term.field_sector_image
    - image.style.og_image
    - taxonomy.vocabulary.sector
  module:
    - image
    - taxonomy
    - user
id: seed_meet_enterprises
label: 'Seed Meet Enterprises'
module: views
description: ''
tag: ''
base_table: taxonomy_term_field_data
base_field: tid
display:
  default:
    id: default
    display_title: Default
    display_plugin: default
    position: 0
    display_options:
      title: 'Seed Meet Enterprises'
      fields:
        view_taxonomy_term:
          id: view_taxonomy_term
          table: taxonomy_term_data
          field: view_taxonomy_term
          relationship: none
          group_type: group
          admin_label: ''
          entity_type: taxonomy_term
          plugin_id: entity_link
          label: ''
          exclude: true
          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
          text: ''
          output_url_as_text: true
          absolute: false
        name:
          id: name
          table: taxonomy_term_field_data
          field: name
          relationship: none
          group_type: group
          admin_label: ''
          entity_type: taxonomy_term
          entity_field: name
          plugin_id: term_name
          label: ''
          exclude: false
          alter:
            alter_text: false
            text: ''
            make_link: true
            path: 'enterprise-profiles{{ view_taxonomy_term }}'
            absolute: false
            external: false
            replace_spaces: true
            path_case: lower
            trim_whitespace: true
            alt: ''
            rel: ''
            link_class: ''
            prefix: ''
            suffix: ''
            target: ''
            nl2br: false
            max_length: 0
            word_boundary: false
            ellipsis: false
            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: value
          type: string
          settings:
            link_to_entity: false
          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
          convert_spaces: true
        field_sector_image:
          id: field_sector_image
          table: taxonomy_term__field_sector_image
          field: field_sector_image
          relationship: none
          group_type: group
          admin_label: ''
          plugin_id: field
          label: ''
          exclude: false
          alter:
            alter_text: false
            text: ''
            make_link: true
            path: 'enterprise-profiles{{ view_taxonomy_term }}'
            absolute: false
            external: false
            replace_spaces: true
            path_case: lower
            trim_whitespace: true
            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: image
          settings:
            image_link: ''
            image_style: og_image
            image_loading:
              attribute: lazy
          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: some
        options:
          offset: 0
          items_per_page: 10
      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: perm
        options:
          perm: 'access content'
      cache:
        type: none
        options: {  }
      empty: {  }
      sorts:
        name:
          id: name
          table: taxonomy_term_field_data
          field: name
          relationship: none
          group_type: group
          admin_label: ''
          entity_type: taxonomy_term
          entity_field: name
          plugin_id: standard
          order: ASC
          expose:
            label: ''
            field_identifier: ''
          exposed: false
      arguments: {  }
      filters:
        status:
          id: status
          table: taxonomy_term_field_data
          field: status
          entity_type: taxonomy_term
          entity_field: status
          plugin_id: boolean
          value: '1'
          group: 1
          expose:
            operator: ''
        vid:
          id: vid
          table: taxonomy_term_field_data
          field: vid
          entity_type: taxonomy_term
          entity_field: vid
          plugin_id: bundle
          value:
            sector: sector
      style:
        type: grid_responsive
        options:
          grouping: {  }
          columns: 2
          cell_min_width: 100
          grid_gutter: 10
          alignment: horizontal
      row:
        type: fields
      query:
        type: views_query
        options:
          query_comment: ''
          disable_sql_rewrite: false
          distinct: false
          replica: false
          query_tags: {  }
      relationships: {  }
      css_class: 'max-w-screen-md  mx-auto px-4 box-content'
      header: {  }
      footer: {  }
      display_extenders: {  }
    cache_metadata:
      max-age: -1
      contexts:
        - 'languages:language_content'
        - 'languages:language_interface'
        - user.permissions
      tags:
        - 'config:field.storage.taxonomy_term.field_sector_image'
  page_1:
    id: page_1
    display_title: Page
    display_plugin: page
    position: 1
    display_options:
      display_extenders: {  }
      path: enterprises
    cache_metadata:
      max-age: -1
      contexts:
        - 'languages:language_content'
        - 'languages:language_interface'
        - user.permissions
      tags:
        - 'config:field.sto

rage.taxonomy_term.field_sector_image'

1
  • Have you got a custom twig template used in this view? Sounds like something in there might be causing the error Commented Jun 18 at 16:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.