Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants