Skip to content
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

Unable to create custom formatter: TypeError: r.getIn is not a function #7109

Open
caendesilva opened this issue Feb 16, 2024 · 0 comments
Open

Comments

@caendesilva
Copy link

Describe the bug
Following the documentation I'm trying to create a custom formatter to read and write the page source as plaintext.

To Reproduce

Add the following:

CMS.registerCustomFormat('blade', '.blade.php', {
  fromFile: text => text,
  toFile: value => value,
});

The admin panel breaks.

Expected behavior

The admin panel should work.

Screenshots

image

Applicable Versions:

  • Decap CMS version: decap-cms@3.1.1
  • Git provider: github
  • Browser version: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36

CMS configuration

backend:
  name: github
  repo: hyde-staging/decap-test
site_url: https://hyde-staging.github.io/decap-test
logo_url: /admin/assets/logo.svg
media_folder: _media
public_folder: media
commit_messages:
  create: Create {{collection}} "{{slug}}" from Decap
  update: Update {{collection}} "{{slug}}" from Decap
  delete: Delete {{collection}} "{{slug}}" from Decap
  uploadMedia: Upload "{{path}}" from Decap
  deleteMedia: Delete "{{path}}" from Decap
  openAuthoring: "{{message}}"
collections:
  - name: posts
    label: Blog Posts
    label_singular: Post
    description: The blog posts for the site
    folder: _posts
    create: true
    slug: "{{slug}}"
    preview_path: posts/{{slug}}
    fields:
      - label: Title
        name: title
        widget: string
      - label: Cover Image
        name: image
        widget: image
      - label: Description
        name: Description
        widget: string
      - label: Category
        name: category
        widget: string
      - label: Date
        name: date
        widget: datetime
      - label: Author
        name: author
        widget: string
      - label: Body
        name: body
        widget: markdown
    publish: true
    type: folder_based_collection
    sortable_fields:
      - commit_date
      - title
      - date
      - author
    view_filters: []
    view_groups: []
  - name: docs
    label: Documentation Pages
    label_singular: Documentation Page
    description: The documentation pages for the site
    folder: _docs
    create: true
    slug: "{{slug}}"
    preview_path: docs/{{slug}}
    fields:
      - label: Title
        name: title
        widget: string
      - label: Body
        name: body
        widget: markdown
    publish: true
    type: folder_based_collection
    sortable_fields:
      - commit_date
      - title
      - commit_author
    view_filters: []
    view_groups: []
  - name: markdown-pages
    label: Markdown Pages
    label_singular: Markdown Page
    description: The Markdown pages for the site
    folder: _pages
    create: true
    slug: "{{slug}}"
    preview_path: "{{slug}}"
    fields:
      - label: Title
        name: title
        widget: string
      - label: Body
        name: body
        widget: markdown
    publish: true
    type: folder_based_collection
    sortable_fields:
      - commit_date
      - title
      - commit_author
    view_filters: []
    view_groups: []
  - name: blade-pages
    label: Blade Pages
    label_singular: Blade Page
    description: The Blade pages for the site
    folder: _pages
    extension: .blade.php
    format: blade
    create: true
    slug: "{{slug}}"
    preview_path: "{{slug}}"
    fields:
      - label: Title
        name: title
        widget: string
      - label: Blade
        name: body
        widget: text
    editor:
      preview: false
    publish: true
    type: folder_based_collection
    sortable_fields:
      - commit_date
      - title
      - commit_author
    view_filters: []
    view_groups: []
publish_mode: simple
slug:
  encoding: unicode
  clean_accents: false
  sanitize_replacement: "-"
display_url: https://hyde-staging.github.io/decap-test
isFetching: false
error: null

Additional context

caendesilva added a commit to hydephp/develop that referenced this issue Feb 16, 2024
This reverts commit 25635de as it does not work. See decaporg/decap-cms#7109
caendesilva added a commit to hyde-staging/experimental-decap-integration that referenced this issue Feb 16, 2024
This reverts commit 25635dec6439b634f89420fcd5dbde38eac8ab16 as it does not work. See decaporg/decap-cms#7109
caendesilva added a commit to hyde-staging/experimental-decap-integration that referenced this issue Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants