撇号 CMS 关系值未保存

Apostrophe CMS relationship values are not being saved

我已经为我的 Apostrophe CMS 部署设置了一些关系值,但这些值没有保存。我看到字段出现并且我能够填充它们,但是当我保存该项目时,这些值消失了。我没有收到任何错误消息,似乎没有任何失败。 下面是我的 beforeConstruct 在组件的 index.js 中的内容:

    options.addFields = [
      {
        name: '_linkPage',
        label: 'Case Study',
        type: 'joinByOne',
        withType: 'apostrophe-page',
        idField: 'pageId',
        required: true,
        help: 'Please pick a Case Study',
        filters: {
          projection: {
            title: 1,
            slug: 1,
            type: 1,
            tags: 1,
            pageHeader: 1,
            pageThumbnails: 1
          }
        },
        relationshipsField: '_cardData',
        relationship: [
          {
            name: 'cardTitle',
            label: 'Card Title (override)',
            type: 'string',
            inline: true
          },
          {
            name: 'cardText',
            label: 'Card Text (override)',
            type: 'string',
            inline: true
          }
        ]
      }
    ].concat(options.addFields || []);
  }

这是我的撇号版本和与撇号相关的项目:

"apostrophe": "2.99.0",
    "apostrophe-groups": "^0.5.34",
    "apostrophe-link-widgets": "^1.0.5",
    "apostrophe-monitor": "^2.0.5",
    "apostrophe-workflow": "2.25.0"

如有任何建议或帮助,我们将不胜感激。我更愿意以这种方式管理数据。

relationship 架构字段 属性 仅在 joinByArray schema fields 上可用。

joinByOne 关系中,理论上您可以直接在进行连接的部分上设置任何相关属性(例如您的 cardText),因为只有一个关系。在一个 joinByArray 字段中,您要加入多个不同的文档,其中每个关系都应该有自己的属性来帮助描述关系,因此可以使用额外的字段。