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

Blog example crashes when changing a collection types to allow i18n #65

Open
tatosjb opened this issue Nov 9, 2022 · 0 comments
Open

Comments

@tatosjb
Copy link

tatosjb commented Nov 9, 2022

Bug report

Required System information

  • Node.js version: v16.13.1
  • NPM version: 8.1.2
  • Strapi version: 4.4.7
  • Database: postgres: 10.12 (image name postgres:10.12-alpine)
  • Operating system: Ubuntu 22.04

Describe the bug

The blog example crashes when changing collection types to enable localization.

Steps to reproduce the behavior

  • Create a project with this command yarn create strapi-app api --template blog --quickstart --ts
  • Run the project
  • Go to the admin panel and click on edit in any of the collection types(could be any of them, you could do with article)
  • Go to advanced tab and check Enable localization for this Content-Type then save.

At this point the server will broke when restarting.

Screenshots

strapi
image

Code snippets

{
  "kind": "collectionType",
  "collectionName": "articles",
  "info": {
    "singularName": "article",
    "pluralName": "articles",
    "displayName": "Article",
    "description": "Create your blog content"
  },
  "options": {
    "draftAndPublish": true
  },
  "pluginOptions": {
    "i18n": {
      "localized": true
    }
  },
  "attributes": {
    "title": {
      "type": "string",
      "pluginOptions": {
        "i18n": {
          "localized": true
        }
      }
    },
    "description": {
      "type": "text",
      "maxLength": 80,
      "pluginOptions": {
        "i18n": {
          "localized": true
        }
      }
    },
    "slug": {
      "type": "uid",
      "targetField": "title"
    },
    "cover": {
      "type": "media",
      "multiple": false,
      "required": false,
      "allowedTypes": [
        "images",
        "files",
        "videos"
      ],
      "pluginOptions": {
        "i18n": {
          "localized": true
        }
      }
    },
    "author": {
      "type": "relation",
      "relation": "manyToOne",
      "target": "api::author.author",
      "inversedBy": "articles"
    },
    "category": {
      "type": "relation",
      "relation": "manyToOne",
      "target": "api::category.category",
      "inversedBy": "articles"
    },
    "blocks": {
      "type": "dynamiczone",
      "components": [
        "shared.media",
        "shared.quote",
        "shared.rich-text",
        "shared.slider"
      ],
      "pluginOptions": {
        "i18n": {
          "localized": true
        }
      }
    }
  }
}

If applicable, add code samples to help explain your problem.

Additional context

Add any other context about the problem here.

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

1 participant