Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Forms & Blueprints

Custom Blueprint save changes file on server but displays the old content afterwards

Solved by Jannic View solution

Started by Jannic 5 years ago · 4 replies · 835 views
5 years ago

Hi,

I realize that two similar questions have been posted here and here, but neither had a solution which helped for me.

I have the following behavior: When changing the content in a markdown editor in my custom blueprint and saving, the file on the server itself changes but the content in my editor jumps back to the previous version. The behavior occurs mostly with small changes like single character changes. It is quite inconsistent behavior and the other posts suggest some issue in the blueprint. So if anyone could give me any pointers there, I would be really happy!

Blueprint:

YAML
title: Steckbrief

form:
  fields:
    header.title:
      type: text
      autofocus: true
      style: vertical
      label: PLUGIN_ADMIN.TITLE

    header.content.facts:
      type: editor
      label: Fakten

    header.content.description:
      type: editor
      label: Beschreibung

Grav Version 1.7.10
Admin v1.10.9
All caching has been disabled

Thanks a lot,
Jannic

5 years ago

@jannic, I'm afraid I cannot replicate the behaviour you are describing using the latest Grav 1.7.16 + Admin 1.10.16.

Although your blueprint is working fine, please be advised, that field content in the header of a page is usually used to define a collection.

YAML
content:
    items: '@self.children'
    order:
        by: date
        dir: desc
    limit: 10
    pagination: true

NB. When experiencing an issue, please try to upgrade to latest version first. It might have been fixed already.

last edited 06/04/21 by pamtbaau
5 years ago

Hi @pamtbaau , thank you very much for the quick reply.

I did upgrade to the latest versions and unfortunately, the issue persists.
Maybe it is worthy to note, that the application is running in a azure app service?
Also, even though caching is disabled, whenever the issue happens a "clear cache" as an admin does resolve the issue.

Should I try to use a different key word than "content"? Or is that unlikely to resolve this?

Thanks, Jannic

5 years ago Solution

In the end, it was the reserved content keyword which created the inconsistencies. Changing it to contents solved the issue.

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Ton Haarmans, 5 years ago
13 1138 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 62 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 136 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 110 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 130 7 months ago