Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin->config->system throws exception when using "content_fallback: { en: [] }" #2199

Open
pamtbaau opened this issue Dec 4, 2021 · 2 comments
Assignees

Comments

@pamtbaau
Copy link

pamtbaau commented Dec 4, 2021

With the following system.yaml:

languages:
  ...
  content_fallback: { en: [] }

Accessing page http://dev-dev/admin/config/system in Admin throws the following error:

An exception has been thrown during the rendering of a template ("Array to string conversion").
…/user/plugins/admin/themes/grav/templates/forms/field.html.twig88

The following configs works fine:

languages:
  ...
  content_fallback: { en: '' }  # or { en: ['en', 'fr' ]}

The comments in /system/config/system.yaml suggests to use an array:

content_fallback: {}                           # Custom language fallbacks. eg: {fr: ['fr', 'en']}

Note: When saving the setting in Admin, it saves it as a string

  content_fallback:
    en: 'en,fr'
@w00fz
Copy link
Member

w00fz commented Feb 4, 2022

I can confirm that empty array [] throws. I think this shouldn't really be ever an array though and just a comma separated string list.

Maybe it is the documentation being not accurate.

@mahagr
Copy link
Member

mahagr commented Feb 7, 2022

It was a bug in the list field. It was taking the whole value en: 'en,fr' instead of the value of the list item: 'en,fr'`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants