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

link field's appearance select bug #19

Open
zanami opened this issue Dec 13, 2022 · 2 comments
Open

link field's appearance select bug #19

zanami opened this issue Dec 13, 2022 · 2 comments

Comments

@zanami
Copy link

zanami commented Dec 13, 2022

I guess there's a small bug in fields/link.ts

    linkResult.fields.push({
      name: 'appearance',
      type: 'select',
      defaultValue: 'default',
      options: appearanceOptionsToUse,
      admin: {
        description: 'Choose how the link should be rendered.'
      }
    });

SelectInput throws "TypeError: undefined is not an object (evaluating 'matchingOption.label')" if 'default' is not in appearanceOptionsToUse around here probably.

There's a place in fields/hero.ts

    linkGroup({
      appearances: ["primary", "secondary"], // no "default" = TypeError
      overrides: {
        name: "buttons",
        label: "Buttons",
        maxRows: 2,
        admin: {
          condition: (_, { type }) => type === "home",
        },
      },
    }),
@pcbal
Copy link

pcbal commented Feb 11, 2023

Case Studies render path "affected" with /case_studies instead of /case-studies here due to some path character replacement when linking the case-study document with the said linkgroup buttons.
The linked URL becomes http://localhost:3000/case_studies/the-case-study-page which ends up in a 404 page. The actual URL path should be http://localhost:3000/case-studies/the-case-study-page for this page to render.
Maybe something related to the said issue.

@jacobsfletch
Copy link
Member

Case Studies render path "affected" with /case_studies instead of /case-studies here due to some path character replacement when linking the case-study document with the said linkgroup buttons.

@pcbal I believe @PatrikKozak fixed this issue with payloadcms/website@3df1353 which might be different than described by @zanami

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants