BoltTranslate / Translate

Provides translation for contenttypes.
Other
43 stars 38 forks source link

[RFC] Twig_Error_Runtime after updating to Translate 4.1.5 #194

Closed peterboorsma closed 5 years ago

peterboorsma commented 5 years ago

I need to update a (large) Bolt site from 3.2.20 > 3.6.3 After updating Bolt and extensions to the latest version I get this error message:

 Twig_Error_Runtime in Template.php line 447:
An exception has been thrown during the rendering of a template ("Warning: Invalid argument supplied for foreach()") in "@bolt/_nav/_secondary.twig" at line 5. 

It happens on all pages in the backend where there is a locale addition to the url. I.e.: /beheer/overview/paginas?_locale=nl

I have a couple of sites running on older versions of Bolt because I experience update problems a lot. Especially when using the Translate extension/labels extension.

I hope someone knows what's the problem here. There's a test site available if someone wants to have a look at it.

My locales in the Translate config are fine, I think:

locales:
    nl_NL:
        label: Nederlands
        slug: nl
    de_DE:
        label: Deutsch
        slug: de
    en_GB:
        label: English
        slug: en

The default locale in config.yml is:

locale: nl_NL

And this is a contenttype (I removed all but one from contenttype.yml in order to find out where things go wrong):

paginas:
    name: Paginas
    singular_name: Pagina
    fields:
        locale:
            type: locale
            group: Tekst
        title:
            type: text
            class: large
            label: Titel
            translatable: true
        slug:
            type: slug
            uses: title
        quote:
            type: text
            class: large
            variant: inline
            label: Quote header
            postfix: '<p>Wordt over de headerafbeelding getoond</p>'
            translatable: true
        teaser:
            type: html
            height: 150px
            label: Korte introductietekst
            translatable: true
        body:
            type: html
            height: 300px
            label: Uitgebreide tekst
            translatable: true
        image:
            type: image
            label: Afbeelding header (1000 x 400 pixels. Fotomateriaal altijd jpg maken.)
            group: Media
        credit:
            type: text
            class: narrow
            label: Naam fotograaf
            variant: inline
            postfix: '<hr>'
            group: Media
        seo:
            type: seo
            group: SEO
        nldata:
            type: hidden
        nlslug:
           type: locale_data
        dedata:
            type: hidden
        deslug:
            type: locale_data
            index: true
        endata:
            type: hidden
        enslug:
            type: locale_data
            index: true
    taxonomy: [ hoofdstukken, tags ]
    listing_template: listing.twig
    recordsperpage: 100
    listing_records: 100
    default_status: publish

Details

peterboorsma commented 5 years ago

This is solved with Translate 4.1.6. Thank you very much.