SOLVED - Changes Not Saving Properly in Panel

Hey guys, I’m running Kirby 2.0.6. I’ve searched the forums and tried what was suggested but none of them work.

Everything works just fine on my local environment (MAMP) but this saving issue happens on my production server (Media Temple)

Inside of the Kirby Panel (on Media Temple server), I’m able to create a new page just fine. But when I try to save any changes, it looks like the values aren’t saving to the content file correctly. Here’s an example of a resulting content file:

T: 

----

M: 

----

A: 

----

E: smoothscroll

----

H: 

----

B: 

It’s odd because the field names aren’t saving properly (only the first letter) and it’s not even saving the correct number of fields. Here is what I have for my blueprint:

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

title: Default Page
pages: true
files: true
fields:
  title:
    label: Title
    type:  text
    placeholder: Title
  title_public:
    type:  text
    placeholder: Public Title
  meta_title:
    placeholder: SEO Meta Title
    type: text
  text:
    placeholder: Text
    type:  textarea
  alert_line:
    type: line
  alert_type:
    type: radio
    label: Alert Box
    options:
      info: Blue Information
      success: Green Success
      notice: Yellow Notice
      error: Red Error
    default: info
    width: 3/4
  alert_text:
    placeholder: Alert Text
    type: text
    help: ex. An email has been sent to you!
  expiration_line:
    type: line
  expiration_date:
    label: Expiration Date
    type: date
    format: mm/dd/yy
    width: 1/4
  expiration_text:
    placeholder: Expiration Text
    type:  textarea
    size:  medium
    help: Leave blank to use default text.
  meta_line:
    type: line
  meta_robots_noindex:
    text: "noindex" on Search Engines
    type: checkbox
    width: 1/2
  meta_robots_nofollow:
    text: "nofollow" on Search Engines
    type: checkbox
    width: 1/2
  meta_description:
    placeholder: SEO Meta Description
    type: textarea
    size: small
  meta_keywords:
    placeholder: SEO Meta Keywords
    type: textarea	
    size: small
  javascript_line:
    type: line
  enable_jquery:
    type: radio
    title: Enable JQuery
    options:
      lightbox: Lightbox
      smoothscroll: Smooth Scroll
    default: smoothscroll
  head_close:
    placeholder: Extra HEAD Javascript
    type:  textarea
    size:  medium
  body_open:
    placeholder: Extra BODY Javascript (Before Content)
    type:  textarea
    size:  medium
  body_close:
    placeholder: Extra BODY Javascript (After Content)
    type:  textarea
    size:  medium

Any ideas?

I can’t say for certain, because it’s possible this is a non issue at this point, but in the past I’ve had issues using camelcase, hyphens and underscores in the field names in blueprints. I just tested it locally and it appears to work correctly, though the underscore becomes a hyphen in the content file.

I’ve been noticing a similar issue, whereby incoming data doesn’t make it into the content files intact.

Aside from missing fields (explained below), I have been struggling with this on a cPanel-managed server for some time, while it works swimmingly on my local machine (a few of them, actually), and my personal host (DreamHost Shared).

The fields are lost due to the array keys being truncated. You have only a single field T in your content file because title and text were both truncated, and up-cased, resulting in overridden array elements. In PHP, array keys must be unique. When it comes time to write the file, only the unique keys are written.

As for basic data loss in the other keys, I’m out of ideas.

Watching this closely!

1 Like

Please check if the mbstring extension is installed on your server. This issue mostly happens when it is missing.

1 Like

Should have noted— mbstring is the only requirement not met by this environment. Good to know this is not an isolated instance.

As always, Bastian, legendary attention and response time.

It worked! Thanks guys. Media Temple charged us $80 to install mbstring for us but it’s worth it; no way in hell am I going back to hacking Wordpress for clients.

Thats just out of proportion for such a common thing - but I’m glad everything works now :slight_smile: