Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-3065

Error updating a binary nodedata

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 4.3
    • 4.3
    • core
    • None

    Description

      The problem occurs when trying to save a dialog with a previously uploaded file (without changing that file):

      javax.jcr.nodetype.ConstraintViolationException: /samples/sampleflv/image[2]: mandatory property {http://www.jcp.org/jcr/1.0}data does not exist
      	at org.apache.jackrabbit.core.ItemImpl.validateTransientItems(ItemImpl.java:462)
      	at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1066)
      	at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:915)
      	at info.magnolia.cms.core.DefaultHierarchyManager.save(DefaultHierarchyManager.java:513)
      	at info.magnolia.module.admininterface.SaveHandlerImpl.save(SaveHandlerImpl.java:250)
      	at info.magnolia.module.admininterface.DialogMVCHandler.onSave(DialogMVCHandler.java:312)
      	at info.magnolia.module.admininterface.DialogMVCHandler.save(DialogMVCHandler.java:214)
      

      I think the cause of the error is that method BinaryNodeData.getBinaryNode(boolean createIfNotExisting) creates a new binary-node even if there is already one, thus duplicating it (image[2]), and leaving the duplicate without any binary data (data does not exist), because no file was uploaded in the dialog.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              pbaerfuss Philipp Bärfuss
              diegoschivo Diego Schivo
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD