cancel
Showing results for 
Search instead for 
Did you mean: 

Broken Media Data handling with CAP 6

gregorw
Active Contributor

Hello CAP Team,

due to the question No payload deserializer available for resource kind 'ENTITY' and mime type 'text/csv' from ieperezortega 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

Accepted Solutions (1)

Accepted Solutions (1)

Arley
Advisor
Advisor

Version 6.2.x of the @sap/cds package was already published to npm.
https://www.npmjs.com/package/@sap/cds

Answers (1)

Answers (1)

Arley
Advisor
Advisor
0 Kudos

Hello Gregor,

Thanks for reporting this issue. I double-checked on that, and it seems that the issue is fixed in @sap/cds: 6.2.0.

Kind regards,
Arley

sdebaerd
Participant
0 Kudos

Hi Arley

Any idea when 6.2.0 will be GA?
Currently in the process of using CAP in a project to upload files.

Thanks in advance

achim_hornung
Discoverer
0 Kudos

Hello Arley,

I figured out a similar problem like Georg. Maybe you can check my post, too.

CAP Fiori Elements: Latest CDS 6.1.3 causes app crash while sorting | SAP Community

I have the same question than Steven, do you know when the cds v. 6.2.0 get released?

Thx in advance

Achim

sdebaerd
Participant
0 Kudos

Hi Achim

The latest version is available now.
For me it resolved the problem that was described.