Skip to Content
2
4 days ago

Broken Media Data handling with CAP 6

121 Views

Hello CAP Team,

due to the question No payload deserializer available for resource kind 'ENTITY' and mime type 'text/csv' from Isaac Perez I've checked if my Media Data example in my bookshop-demo sample project is still working. Because I know from another project that with the current SAPUI5 version and an OData V4 draft enabled Entity all the UI is provided automatically. But when trying I ran into this error message

SQLITE_ERROR: no such column: mediaType

As soon as I downgraded to CAP 5 the application was working again. That is also the current state of the main branch. To have a comparison I've created the fork fiori-elements-for-media of the cloud-cap-samples project. When you run this sample with:

cds watch media-sqlite

and then open:

http://localhost:4004/$fiori-preview/sap.capire.media.MediaServer/MediaWithDraft#preview-app

you will see this error message:

SQLITE_ERROR: no such column: mediaType in:
SELECT ID,
  mediaType AS "content@odata.mediaContentType",
  fileName,
  IsActiveEntity,
  HasActiveEntity
FROM (
    SELECT ALIAS_1.ID,
      ALIAS_1.mediaType AS "content@odata_mediaContentType",
      ALIAS_1.fileName,
      IsActiveEntity,
      HasActiveEntity,
      DraftAdministrativeData_DraftUUID
    FROM sap_capire_media_MediaServer_MediaWithDraft_drafts ALIAS_1
      INNER JOIN DRAFT_DraftAdministrativeData filterAdmin ON ALIAS_1.DraftAdministrativeData_DraftUUID = filterAdmin.DraftUUID
    WHERE filterAdmin.InProcessByUser = ?
    UNION ALL
    SELECT ID,
      mediaType AS "content@odata_mediaContentType",
      fileName,
      ? AS IsActiveEntity,
      ? AS HasActiveEntity,
      (
        SELECT DraftAdministrativeData_DraftUUID
        FROM sap_capire_media_MediaServer_MediaWithDraft_drafts ALIAS_2
        WHERE ALIAS_1.ID = ALIAS_2.ID
      )
    FROM sap_capire_media_MediaServer_MediaWithDraft ALIAS_1
    WHERE NOT EXISTS (
        SELECT 1
        FROM sap_capire_media_MediaServer_MediaWithDraft_drafts ALIAS_2
          INNER JOIN DRAFT_DraftAdministrativeData filterAdmin ON ALIAS_2.DraftAdministrativeData_DraftUUID = filterAdmin.DraftUUID
        WHERE filterAdmin.InProcessByUser = ?
          AND ALIAS_1.ID = ALIAS_2.ID
      )
  ) AS sap_capire_media_MediaServer_MediaWithDraft_drafts
ORDER BY ID COLLATE NOCASE ASC
LIMIT 30 OFFSET 0
cds --version returns:
@capire/samples: 2.0.0
@sap/cds: 6.1.3
@sap/cds-compiler: 3.1.2
@sap/cds-dk: 6.1.5
@sap/cds-dk (global): 6.1.5
@sap/cds-foss: 4.0.0
@sap/cds-mtx: -- missing --
Node.js: v14.20.0
home: /Users/gwolf/Documents/Projects/cap/cloud-cap-samples/node_modules/@sap/cds
If needed I can also file an incident via SAP Support.Best Regards
Gregor