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

Blueprint: Error on save

Started by Amaury Hanser 9 years ago · 4 replies · 915 views
9 years ago

Hello,

I'm working on a page blueprint.
In the admin panel, I have the result I want and it shows the information from the markdown page.
Therefore, when I try to save the page in the admin panel, I have this error:

TXT
> Argument 1 passed to Grav\Common\Page\Page::move() must be an instance of Grav\Common\Page\Page, null given, called in C:\wamp\www\charitybackpackers\user\plugins\admin\classes\admincontroller.php on line 498 and defined

I know that it comes from the blueprint, but I can't find the mistake.

Here is the markdown file of the desired output:

YAML
googlemaps:
    map:
        center: 51.009314, 4.061254
        zoom: 12
        markers:
            - location: 51.009358, 4.061578
              title: Title of the 1st marker
              zIndex: 1
              timeout: 1000
              info: Description of the 1st marker
            - location: 51.017227, 4.073198
              title: Title of the 2nd marker
              zIndex: 2
              timeout: 2000

Here is the blueprint I wrote:

YAML
title: Marker
form:
  fields:
    tabs:
      type: tabs
      active: 1
      fields:
        tab:
          type: tab
          title: Google maps
          fields:
            header.googlemaps:
              type: fieldset
              title: "Options of the map:"
              fields:
                header.googlemaps.map.center:
                  type: text
                  label: "Center:"
                header.googlemaps.map.zoom:
                  type: text
                  label: "Zoom:"
            header.googlemaps.map.markers:
              type: list
              btnLabel: Add one marker
              label: "Your markers:"
              fields:
                .title:
                  label: Title
                  type: text
                .info:
                  label: Description
                  type: text
                .location:
                  label: Location
                  type: text
                .zIndex:
                  label: zIndex
                  type: text
                .icon:
                  label: Icon
                  type: text
                .timeout:
                  label: Timeout
                  type: text

And here is a screenshot of the admin panel:
<img src="//cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex036/uploads/getgrav/original/1X/d5517db07284a8bfb463097dcc37a56fbb606e9a.png" width="690" height="368">

As you can see, it reads the pre-existing info in the markdonw file, but if I save, i get the error.

If anyone could help me with this.
Thank you in advance ! 🙂

9 years ago

You need to extend from the default page blueprint, because some fields are mandatory for a correct handling, in this case the folder field is missing.

You can remove some fields, like the default content tab, but more general-usage page options should be kept.

This will fix the problem at hand. We should have a more meaningful message.

👍 1
9 years ago

I've also bumped into this issue while creating blueprints. Is it possible to put together a list of those mandatory fields? Otherwise is this whole "create a completely custom blueprint" and also unsetting some fields in an extended blueprint quite dangerous :D
Thanks.

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Ton Haarmans, 5 years ago
13 1133 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 60 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 131 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 107 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 125 7 months ago