getkirby-v2 / panel

This is the deprecated admin panel for Kirby v2.
http://getkirby.com
Other
134 stars 70 forks source link

Bug in new options section of the blueprints - array to string conversion #787

Closed jbeyerstedt closed 8 years ago

jbeyerstedt commented 8 years ago

I just wanted to test the new function to disable all the different setting of the site settings section as mentioned in #693.

But I get warnings about array to string conversions in the panel.

bildschirmfoto 2016-02-29 um 12 28 31

It's also a problem in the modal, where you can change the template. (I scrolled to the side, to show the more interesting part of the path.)

bildschirmfoto 2016-02-29 um 12 28 17

It does not matter, if the new keywords are added to the blueprint or not. Obviously the warning is not displayed, if the template switch is disabled, but otherwise there is this misbehavior.

distantnative commented 8 years ago

Could you post that part from your blueprint as well, please?

jbeyerstedt commented 8 years ago

This is the template of the page:

title: Foto-Karussell
pages: false
preview: parent
files:
  sortable: true
  fields:
    title:
      label: Title (z.Zt. nicht benutzt)
      type:  text
    heading:
      label: Bildüberschrift
      type:  text
    caption:
      label: Bildtext
      type:  textarea
      header1: h3
      header2: h4
options:
  preview: true
  status: false
  #template: false
  url: false
  delete: true

fields:
  info:
    label: NOTICE
    type:  info
    text:  >
      foobar
  title:
    label: Title (has no fuction)
      de:  Seitenüberschrift (hat keine Funktion)
    type:  text

and this is the blueprint of the new template, where this page would be changed to:

title: Group Subpage
   de: Unterseite für Gruppe
pages:
  template:
    - carousel
files: true
  sortable: true
options:
  preview: true
  status: true
  template: true
  url: true
  delete: true

fields:
  title:
    label: page title for menu
      de:  Seitentitel für das Menü
    type:  text
    width: 1/2
  heading:
    label: heading of article
      de:  ggf. lange Überschrift des Artikels
    type:  text
    width: 1/2

  text:
    label: Text
      de:  Text
    type:  markdown
    header1: h3
    header2: h4

  gallery:
    text:  enable image gallery
      de:  Bildergallerie aktivieren
    type:  checkbox
  text_lower:
    label: Text below Images
      de:  Text unter Bildergallerie
    type:  markdown
    header1: h3
    header2: h4

But the first error is appearing at almost every page.

texnixe commented 8 years ago

Looks like you have an indentation error in the first blueprint

fields:
  info:
    label: NOTICE
    type:  info
    text:  >
      foobar
    title: //wrong indentation
    label: Title (has no fuction)
      de:  Seitenüberschrift (hat keine Funktion)
    type:  text

and also you have a value for label and then also a language label on this line:

label: Title (has no fuction)
      de:  Seitenüberschrift (hat keine Funktion)
jbeyerstedt commented 8 years ago

Sorry, the indentation was an error at copying the blueprint to the comment field and shortening the info text. This is not present in my real blueprint. (I'll change this in my last post).

The translation always worked as some kind of default and translation. I don't know, wether it was in the docs some time. Anyway, I will try if it changes the behavior.

jbeyerstedt commented 8 years ago

and also you have a value for label and then also a language label on this line:

But that was the right hint: The issue is present, if the current template has a multi-lingual title. I set up a new starterkit, and modified the site and projects blueprints:

blueprints/site.php

<?php if(!defined('KIRBY')) exit ?>

title: Site
pages:
  template:
    - default
    - projects
fields:
  title:
    label: Title
    type:  text
  author:
    label: Author
    type:  text
  description:
    label: Description
    type:  textarea
  keywords:
    label: Keywords
    type:  tags
  copyright:
    label: Copyright
    type:  textarea

blueprints/projects.php

<?php if(!defined('KIRBY')) exit ?>

title:
  en:  Projects
  de:  Projekte
options:
  template: true
pages:
  template:
    - project
    - default
files: false
fields:
  title:
    label: Title
    type:  text
  text:
    label: Text
    type:  textarea

And I enabled the debug mode in the config.

Which leads to this php notice:

bildschirmfoto 2016-02-29 um 14 36 10
distantnative commented 8 years ago

This has been fixed on the develop branch.