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: Choice field not updating when _ is used in the ID #235

Closed
wemasoe opened this issue Jan 23, 2022 · 7 comments
Closed

Issue: Choice field not updating when _ is used in the ID #235

wemasoe opened this issue Jan 23, 2022 · 7 comments
Labels
bug Something isn't working
Projects
Milestone

Comments

@wemasoe
Copy link

wemasoe commented Jan 23, 2022

When using choice für an own content trype with an underscroe in "title" "title": "mydoc_sidebar" and after changing the frontmatter taxonomy from one choice to another or deleting the field. the underscore title name like in this example "title": "mydoc_sidebar" is not beeing written to the file.

After selecting another title name without an underscore
"title": "Choice 2"the title with the underscore can be selected
"title": "mydoc_sidebar" again.

This seems only to happen when like in this example there are qoutemarks set.
sidebar: '' in the field.

 "frontMatter.taxonomy.contentTypes": [
    {
      "name": "default",
      "pageBundle": false,
      "fields": [
...
    {
      "name": "documentation",
      "pageBundle": false,
      "fields": [
        {
...
        {
          "title": "Sidebar",
          "name": "sidebar",
          "type": "choice",
          "choices": [
            {
              "id": "mydoc_sidebar",
              "title": "mydoc_sidebar"
            },
            {
              "id": "2",
              "title": "Choice 2"
            },
            {
              "id": "3",
              "title": "Choice 3"
            }
          ],
          "multiSelect": true
        },
...

image

@estruyf
Copy link
Owner

estruyf commented Jan 23, 2022

I've been trying to reproduce the behavior, but not sure if I'm getting it right. Is this what you are doing as well?

Screen.Recording.2022-01-23.at.11.08.20.mp4

If not, what do you do differently?

@estruyf estruyf changed the title Issue: Issue: Choice field not updating when _ is used in the ID Jan 23, 2022
@wemasoe
Copy link
Author

wemasoe commented Jan 23, 2022

@estruyf thx for your reply.

i am using wsl!
maybe this could be a reason for different outputs/behavior?

[2022-01-23 15:27:24.772] Resolving wsl+ubuntu, resolveAttempt: 1
[2022-01-23 15:27:25.359] Starting VS Code Server inside WSL (wsl2)
[2022-01-23 15:27:25.359] Extension version: 0.63.13

which tool do you use for video snippets? I will give a reply, for now i did not know how to take a video snippet right now.

have a nice start into the next week.

@wemasoe
Copy link
Author

wemasoe commented Jan 23, 2022

java.md.-.just-the-docs.WSL_.Ubuntu.-.Visual.Studio.Code.2022-01-23.16-39-59.mp4

Windows + G is a nice feature :-) Google also :-)

@estruyf
Copy link
Owner

estruyf commented Jan 24, 2022

@wemasoe can you show me your content type settings in a side-by-side view? WSL should not be making a difference in this case, as WSL only matters on file level / paths.

@wemasoe
Copy link
Author

wemasoe commented Jan 24, 2022

image

i do not know how to make a side by side in text format on github.
so only screenshot and code.

`{
    "name": "documentation",
    "pageBundle": false,
    "fields": [
      {
        "title": "Layout",
        "name": "layout",
        "type": "choice",
        "choices": [
          "default",
          "{{title}}",
          "{{slug}}"
        ]
      },
      {
        "title": "Title",
        "name": "title",
        "type": "string"
      },
      {
        "title": "Permalink",
        "name": "permalink",
        "type": "string",
        "default": "{{permalink}}"
      },
      {
        "title": "Parent",
        "name": "parent",
        "type": "choice",
        "choices": [
          "markdown",
          "{{title}}",
          "{{slug}}"
        ]
      },
      {
        "title": "Sidebar",
        "name": "sidebar",
        "type": "choice",
        "choices": [
          {
            "id": "mydoc_sidebar",
            "title": "mydoc_sidebar"
          },
          {
            "id": "2",
            "title": "Choice 2"
          },
          {
            "id": "3",
            "title": "Choice 3"
          }
        ],
        "multiSelect": true
      },
      {
        "title": "Tags",
        "name": "tags",
        "type": "tags"
      },
      {
        "title": "Permalink1",
        "name": "permalink1",
        "type": "choice",
        "choices": [
          "{{permalink}}",
          "{{title}}",
          "{{slug}}"
        ]
      },
      {
        "title": "Description",
        "name": "description",
        "type": "string",
        "default": "{{slug}}"

      },
      {
        "title": "Publishing date",
        "name": "date",
        "type": "datetime"
      },
      {
        "title": "Content preview",
        "name": "preview",
        "type": "image"
      },
      {
        "title": "Is in draft",
        "name": "draft",
        "type": "boolean"
      },
      {
        "title": "Categories",
        "name": "categories",
        "type": "categories"
      },
      {
        "title": "Navigation weight",
        "name": "weight",
        "type": "number"
      },
      {
        "title": "Type",
        "name": "type",
        "type": "choice",
        "choices": [
          "documentation",
          "default",
          "published"
        ]
      }
    ]
  }
],`
"frontMatter.taxonomy.contentTypes": [
    {
      "name": "default",
      "pageBundle": false,
      "fields": [
        {
          "title": "Title",
          "name": "title",
          "type": "string"
        },
        {
          "title": "Description",
          "name": "description",
          "type": "string"
        },
        {
          "title": "Publishing date",
          "name": "date",
          "type": "datetime"
        },
        {
          "title": "Content preview",
          "name": "preview",
          "type": "image"
        },
        {
          "title": "Is in draft",
          "name": "draft",
          "type": "boolean"
        },
        {
          "title": "Tags",
          "name": "tags",
          "type": "tags"
        },
        {
          "title": "Type",
          "name": "type",
          "type": "choice",
          "choices": [
            "documentation",
            "default",
            "published"
          ]
        },
        {
          "title": "Categories",
          "name": "categories",
          "type": "categories"
        }
      ]
    },

@estruyf
Copy link
Owner

estruyf commented Jan 24, 2022

Thanks! This information helped a lot and should be fixed with the upcoming release. Already testable in the beta.

@estruyf estruyf added the bug Something isn't working label Jan 24, 2022
@estruyf estruyf added this to the 6.0.0 milestone Jan 24, 2022
@estruyf estruyf added this to Done in v6.0.0 Jan 24, 2022
@wemasoe
Copy link
Author

wemasoe commented Jan 24, 2022

@estruyf thank you, it works :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

No branches or pull requests

2 participants