Coder Social home page Coder Social logo

Comments (4)

denolfe avatar denolfe commented on September 23, 2024

Thank you for the report @richardvanbergen. Are you able to provide the collection config or the subset that contains the localized field within a block?

from payload.

richardvanbergen avatar richardvanbergen commented on September 23, 2024

Hi, it's basically a page collection that looks like this:

const PageCollection: CollectionConfig = {
  slug: 'page',
  admin: {
  },
  labels: {
    singular: 'Page',
    plural: 'Pages',
  },
  fields: [
    ...PageMetaFields,
    {
      name: 'content',
      label: 'Content Blocks',
      type: 'blocks',
      labels: {
        singular: 'Layout',
        plural: 'Layouts',
      },
      blocks: [
        HeroSchema,
        ClientListSchema,
        CarouselSchema,
        IllustratedCopySchema,
        ContentGridSchema, // <-- this guy right here caused the error
        HubspotFormSchema,
        CtaBannerSchema,
        ProcessStepsSchema,
      ],
    },
  ],
}

export default PageCollection

The block that caused the error looks like this:

const ContentGridSchema: Block = {
  slug: 'contentGrid',
  imageURL: 'https://brightvision.fra1.cdn.digitaloceanspaces.com/admin-preview-images/rows-and-columns.png',
  imageAltText: 'A component for organizing content into flexible rows and columns.',
  labels: {
    singular: 'Rows & Columns',
    plural: 'Rows & Columns',
  },
  fields: [
    {
      type: 'array',
      name: 'grids',
      fields: [
        {
          type: 'row',
          fields: [
            {
              type: 'number',
              label: 'Maximum Columns',
              name: 'numberOfColumns',
              admin: {
                width: '50%',
              },
            },
          ],
        },
        {
          type: 'array',
          name: 'columns', // <-- more specifically this guy
          fields: [
            {
              type: 'richText',
              name: 'content',
              localized: true,
            },
          ],
        },
      ],
    },
  ],
}

export default ContentGridSchema

And this is my payload config with the internationalization:

// ... bunch of imports

export default buildConfig({
  serverURL: process.env.PAYLOAD_PUBLIC_SERVER_URL,
  collections: [
    Page,
    Client,
    Testimonial,
    MediaVideo,
    MediaImage,
    APIUser,
    Link,
    HubspotFormEmbed,
  ],
  globals: [
    SiteConfig,
    MainMenu,
    Error404,
    Error500,
  ],
  localization: {
    locales: [
      'en',
      'dk',
      'sv',
      'no',
      'fi',
    ],
    defaultLocale: 'en',
    fallback: true,
  },
  admin: {
    components: {
      graphics: {
        Icon: Favicon,
        Logo: Logo,
      },
      views: {
        Dashboard,
      },
    },
  },
})

from payload.

richardvanbergen avatar richardvanbergen commented on September 23, 2024

Let me know if you need any more information.

from payload.

github-actions avatar github-actions commented on September 23, 2024

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

from payload.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.