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

Create a sub-page doesn't set the fieldset property within the page markdown file #1697

Closed
fkwakkenbos opened this Issue Jan 9, 2018 · 10 comments

Comments

Projects
None yet
3 participants
@fkwakkenbos

fkwakkenbos commented Jan 9, 2018

Expected behaviour

When we create a sub-page, the new page markdown file should contain a fieldset parameter/property with the correct (choosen) fieldset.

Actual behaviour

When we create a sub-page, the new page markdown file is missing the fieldset parameter/property.

Steps to reproduce

  1. Create a normal page, etc...
  2. Create a sub-page below the normal page using the submenu in the CP at the right of the normal page you just created in step 1
  3. Choose the correct fieldset for the new sub-page
  4. Save the new sub-page

Server Details

Operating System:
Mac OS X

Web Server:
MAMP Pro

PHP Version:
7.1.1

Statamic Version:
5.1.46

Updated from an older Statamic or fresh install:
Updated from 5.1.??

List of installed addons:
No add-ons

Logs

No error log entries

@dannyuk1982

This comment has been minimized.

dannyuk1982 commented Jan 9, 2018

Your statamic version is wrong

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Jan 9, 2018

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Jan 9, 2018

I can't see this issue. Whats the name of the fieldset you're trying to use? Does it happen with all fieldsets?

@fkwakkenbos

This comment has been minimized.

fkwakkenbos commented Jan 9, 2018

Sorry... We are running Statamic version 2.7.3 :-)

The fieldset name is: page_detail
Hmm interesting.
When I use a new simple fieldset, the problem does NOT occur.

Here is my fieldset: page_detail

taxonomies: false
title: page detail
create_title: Detail page
fields:
  title:
    type: title
    display: Title
    localizable: true
  page_top_layout:
    type: select
    display: Page Top Layout
    options:
      it-solutions: IT Solutions
      it-services: IT Services
      it-buying: IT Buying
      general: General (like about...)
    width: 25
    default: it-solutions
    validate: required
  meta_title:
    type: text
    display: Meta Title
    validate: required|between:1,160
  meta_description:
    type: text
    display: Meta Description
    validate: required|between:1,255
  content_top:
    type: redactor
    display: Content Top
    settings: Standard
    container: main
    folder: /
    width: 50
  image_top:
    type: assets
    display: Image Top
    container: main
    folder: /
    max_files: 1
    mode: grid
    width: 50
  content_grid:
    type: grid
    display: Content Grid
    fields:
      section_image:
        type: assets
        display: Block afbeelding
        instructions: Als geen image, dan toont die deze ook niet.
        container: main
        folder: /
        mode: grid
        max_files: 1
      content:
        type: redactor
        display: Content
        settings: Standard
        container: main
        folder: /
      style_type:
        type: select
        display: Style Type
        options:
          html_only: HTML only
          html_only_blue: HTML only but Blue background
          icon_blocks: Icon blocks
          2cols_html_image: HTML left and Image right
          2cols_image_html: HTML right and Image left
        default: html_only
      icon_blocks:
        type: grid
        display: Icon Blocks
        fields:
          title:
            type: text
            display: Title
          icon_class:
            type: text
            display: Icon Class
            width: 25
            default: callbell
          internal_link:
            type: pages
            display: Internal Link
            max_items: 1
            mode: panes
            width: 25
          external_link:
            type: text
            display: External Link
            width: 25
        mode: table
        max_rows: 99
    mode: stacked
  template:
    type: template
    display: Template
    default: page-detail

@fkwakkenbos

This comment has been minimized.

fkwakkenbos commented Jan 9, 2018

By the way, when I create a page at the root (without a parent page), the problem does also NOT occur.
I've also added some screenshots and explanation within the Slack statamic-v2 channel.

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Jan 9, 2018

Hmm even that works for me, if I copy/paste your fieldset and give it the same filename.

Do you have any addons installed?

@fkwakkenbos

This comment has been minimized.

fkwakkenbos commented Jan 9, 2018

No, we have a fresh Statamic without add-ons installed.

Did you tried to create a sub-page?
image
image

It works when you use the normal Create button, but it doesn't work when creating a sub-page by using the dropdown menu.

@fkwakkenbos fkwakkenbos closed this Jan 9, 2018

@fkwakkenbos fkwakkenbos reopened this Jan 9, 2018

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Jan 9, 2018

Yes, I created a sub page, and a sub sub page.

@fkwakkenbos

This comment has been minimized.

fkwakkenbos commented Jan 9, 2018

I've set up a example repository for this issue.
See: https://github.com/flooris/statamic-issue-1697

Then create a sub page
image
Choose: "page detail" as a fieldset.
Fill in some shit and click the Save button.
image

Than take a look at the markdown file, the fieldset is missing.
image

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Jan 9, 2018

Beautiful, thanks for that. The issue is that the fieldset is removed if it's the same as the parent's.
It should have been removed only if its the same as whats in the cascade (ie. added to folder.yaml)

Although, maybe thats a bad idea too. We'll sort it out for the next release.

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