Describe the bug
I was trying to create a model with polymorphic relation.
I have read docs - https://strapi.io/documentation/3.0.0-alpha/concepts/models.html#relations
When a model contains a polymorphic relation *, the content manager cannot display the model into the Admin UI.
Steps to reproduce the behavior
- Go to Content-Type Builder
Define new model with any kind of fields, for example, Favourite
Go to created files and edit JSON schema file( favourite.settings.json)
In section, attributes add a polymorphic field
{ "kind": "collectionType", "collectionName": "navigations_items", "info": { "name": "Navigations items", "description": "" }, "options": { "increments": true, "timestamps": true, "draftAndPublish": false }, "pluginOptions": { "i18n": { "localized": true }, "content-manager": { "visible": true }, "content-type-builder": { "visible": true } }, "attributes": { "title": { "pluginOptions": { "i18n": { "localized": true } }, "type": "string", "required": true, "configurable": false }, "type": { "type": "enumeration", "enum": [ "INTERNAL", "EXTERNAL" ], "default": "INTERNAL", "configurable": false }, "path": { "type": "text", "targetField": "title", "configurable": false }, "externalPath": { "type": "text", "configurable": false }, "uiRouterKey": { "type": "string", "configurable": false }, "menuAttached": { "type": "boolean", "default": false, "configurable": false }, "order": { "type": "integer", "default": 0, "configurable": false }, "parent": { "model": "navigations-items", "columnName": "parent", "configurable": false, "default": null }, "master": { "columnName": "master", "model": "navigation", "configurable": false }, "entities": { "collection": "*", "filter": "field" } } }
- Click on it inside the collection types.
- Then you will get this error into the chrome javascript console:
2main.9d4912ad.chunk.js:1 TypeError: Cannot read property 'pluginOptions' of undefined at main.9d4912ad.chunk.js:1 at Array.reduce (<anonymous>) at d (main.9d4912ad.chunk.js:1) at b (main.9d4912ad.chunk.js:1) at main.9d4912ad.chunk.js:1 at c (main.9d4912ad.chunk.js:1) at Generator._invoke (main.9d4912ad.chunk.js:1) at Generator.next (main.9d4912ad.chunk.js:1) at n (main.9d4912ad.chunk.js:1) at l (main.9d4912ad.chunk.js:1)
Expected behavior
Display the model into the content manager
System
Node.js version: 12.22.2
NPM version: 6.13.13
Strapi version: 3.6.5
Database: Mysql
Operating system: macOS Big Sur
Additional context
Thanks for your help