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

Issue: DataFileHelper::process: Function yaml.safeLoad is removed in js-yaml 4. #717

Closed
ReLater opened this issue Nov 30, 2023 · 1 comment
Labels
Projects

Comments

@ReLater
Copy link

ReLater commented Nov 30, 2023

Describe the bug
When I try to open in the FM Dashboard in tabulator "data" a data collection from a yaml file with snippets I can't expand it and see errors in the console:

["ERROR" - 23:11:49]  DataFileHelper::process: Function yaml.safeLoad is removed in js-yaml 4. Use yaml.load instead, which is now safe by default.
["ERROR" - 23:11:49]  𝖥𝗋𝗈𝗇𝗍 𝖬𝖺𝗍𝗍𝖾𝗋 𝖢𝖬𝖲: Something went wrong while processing the data file. Check your file and output log for more information. 

To Reproduce
Steps to reproduce the behavior:

  1. Create a yaml file inside [[workspace]]/site/data/biShortcuts.yaml
  2. Enter content like this: https://github.com/GHSVS-de/hugo_layoutsghsvs/blob/main/dist/data/biShortcuts.yaml
  3. In frontmatter.json add block
...
  "frontMatter.data.files": [
    {
      "id": "biShortcuts",
      "title": "bi-Shortcode-Abkuerzung",
      "file": "[[workspace]]/site/data/biShortcuts.yaml",
      "fileType": "yaml",
      "labelField": "short",
      "schema": {
        "title": "Bi-Abkuerzung",
        "type": "object",
        "required": [
          "short",
          "icon"
        ],
        "properties": {
          "short": {
            "type": "string",
            "title": "Short"
          },
          "icon": {
            "type": "string",
            "title": "Icon"
          },
          "class": {
            "type": "string",
            "title": "CSS Class"
          }
        }
      }
    }
  ],
...
  1. Be aware of "fileType": "yaml",!
  2. Open Workspace.
  3. Open FM Dashboard.
  4. Click tabulator data.
  5. Click on collection "bi-Shortcode-Abkuerzung"
  6. Nothing happens but message "𝖥𝗋𝗈𝗇𝗍 𝖬𝖺𝗍𝗍𝖾𝗋 𝖢𝖬𝖲: Something went wrong while processing the data file. Check your file and output log for more information."
  7. Output log displays errors (see above).

Expected behavior
Adding and editing of collection entries possible.

**

  • Current VS Code 1.84.2 on Windows 10.
  • Front Matter CMS v9.3.1

Additional context
I know that it worked with older versions but I don't know which one because of a longer pause since October 2022 or so.

I think the error comes from here

return yaml.safeLoad(dataFile || '');

@ReLater ReLater added the bug Something isn't working label Nov 30, 2023
@estruyf estruyf added this to To do in 9.4.0 via automation Dec 8, 2023
@estruyf estruyf moved this from To do to In progress in 9.4.0 Dec 8, 2023
@estruyf
Copy link
Owner

estruyf commented Dec 8, 2023

Thanks @ReLater, the fix will be included in version 9.4.0.

@estruyf estruyf mentioned this issue Dec 12, 2023
@estruyf estruyf closed this as completed Dec 12, 2023
9.4.0 automation moved this from In progress to Done Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
9.4.0
Done
Development

No branches or pull requests

2 participants