An exception has been thrown during the rendering of a template ("Array to string conversion") after upgrade

Hi,

I have upgraded and old Grav website from version 0.9 to 1.7. Most of it works except for one page.

<div class="modular-row team">
    {{ content|raw }}
    <div class="members">
        {% for member in page.header.members %}
        <div class="member">
            <img src="{{page.media[member.image].url}}" alt="">
            <h4>{{ member.name }}</h4>
            <span>{{ member.title }}</span>
            <hr>
            <p>{{ member.info }}</p>
            <ul class="social-icons">
                <li>
                    <a href="{{ member.social_twitter }}">
                        <i class="fa fa-twitter"></i></a>
                </li>
                <li>
                    <a href="{{ member.social_facebook }}">
                        <i class="fa fa-facebook"></i></a>
                </li>
                <li>
                    <a href="{{ member.social_feed }}">
                        <i class="fa fa-rss"></i></a>
                </li>
            </ul>
        </div>
        {% endfor %}
    </div>
    <div class="callout-line"></div>
</div>
---
title: Team
menu: false
members:
    - name: NETWORK, TELECOM, AUTOMATION ENGG.
      image: structured-cabling.jpg
      info: 
        - "Network Administration and Implementation,"
        - "Automation & Instrumentation,"
        - "Telecommunication Engineering,"
        - "CCTV Camera Security System."
    - name: IT SERVICES
      image: software-code.jpg
      info: 
        - "Facility Management, Call Centers, Helpdesk"
        - "Technical Support, Data Entry,"
        - "Managing Business Processes"
        - "Data Base Administration (Oracle)"
        - "Software Development, Training & maintenance"
    - name: ENGG. PROJECTS & CONSTRUCTIONS
      image: optic-fibre.jpg
      info: 
        - "Engineering Projects & Construction,"
        - "Specialised Technical Consultancy – Engineering & Projects,"
        - "Irrigation and Water Distribution System (HDPE)"
---
## What Do We Do?
We specialize in providing a wide range of IT and engineering services. Executing projects and tasks with high standards of quality, innovation and dedication.

Your {{ member.info }} is an array, but template tries to display it as a string.
There are several ways to fix this (like iterating the array and displaying each element on its own), but the easiest would be:

{{ member.info|join(' ') }}

I think space fits here, because you already have commas in your info strings

1 Like

Actually I would like to display the β€œinfo:” array as an unordered list.

@kalimati, Beware that theme Deliver is not compatible with Grav 1.7. Template /partials/simplesearch_base.html.twig does not render assets correctly:

Filter |raw should be added.

1 Like

Then something like

{% if member.info|length %}
  <p>
    <ul>
      {% for info in member.info %}
        <li>{{ info }}</li>
      {% endfor %}
    </ul>
  </p>
{% endif %}

But keep in mind what @pamtbaau mentioned about theme support

1 Like