[MGNLUI-5545] Copy and paste actions are resolving wrong implementation for ContentClipboard in new UI framework Created: 06/Dec/19  Updated: 17/Dec/21

Status: Selected
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Jaroslav Simak Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

Configuration for copy and paste resolves implementation of

info.magnolia.ui.framework.ContentClipboard

to

info.magnolia.ui.contentapp.browser.JcrContentClipboard

which leads to:

java.lang.ClassCastException: info.magnolia.ui.datasource.jcr.JcrNodeWrapper cannot be cast to info.magnolia.ui.vaadin.integration.jcr.JcrItemId

To reproduce: configure copy and paste actions in an app like this:

      copy:
        icon: icon-copy
        $type: copyContentAction
        availability:
          multiple: true
          properties: true
          rules:
            - name: canCopyContent
              $type: canCopyContentRule
      paste:
        icon: icon-paste
        $type: pasteContentAction
        availability:
          root: true
          rules:
            - name: canPasteContent
              $type: canPasteContentRule
            - name: notDeleted
              $type: jcrIsDeletedRule
              negate: true


 Comments   
Comment by Roman Kovařík [ 06/Dec/19 ]

As workaround, specify proper impl for your app in a module descriptor, see https://git.magnolia-cms.com/projects/MODULES/repos/dam/browse/magnolia-dam-app-jcr/src/main/resources/META-INF/magnolia/dam-app-jcr.xml#10.

Generated at Mon Feb 12 09:27:38 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.