Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-31024

Auto versioning snapshots empty_picture.png instead uploaded file



    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Automation


      With auto versioning enabled on documents with Picture facet and beforeUpdate="false" on the VersioningService policy definition, the temporary placeholder empty_picture.png is processed in the version snapshot instead of the actual uploaded file. 

      With the contribution below, a minor version is created when a document is created and each time the main file is replaced. When you create a document and then replace the file, the version becomes 0.2. When selecting to view version 0.1, the empty_picture.png is shown instead of the initial version of the file. This pattern recurs for version 0.3 and viewing 0.2, etc.

      We believe this can be corrected by treating the presence of the empty_picture.png as effectively the same as empty, 0 byte or null.  

      This behavior may have been introduced by NXP-30526, which avoids regenerating already computed picture views.




      <?xml version="1.0"?>
      <component name="com.lululemon.versioning.service.contrib">
          <extension target="org.nuxeo.ecm.core.api.versioning.VersioningService" point="policies">
              <policy id="document-created-auto-minor-version" increment="MINOR" beforeUpdate="false" order="20">
              <policy id="file-content-changed-minor-version" increment="MINOR" beforeUpdate="false" order="21">
                  <!-- PDA-247 - Only create minor version on change when change is not from nuxeo drive src
                  and file updates -->
          <extension target="org.nuxeo.ecm.core.api.versioning.VersioningService" point="filters">
              <filter id="file-content-updated-filter">
                  <!-- Cover conditions when file changes AND when a new file is added without a previous
                  one existing already -->
                          currentDocument.contextData.source != "drive" and (
                              (previousDocument.file.content == null and currentDocument.file.content != null) or
                              (previousDocument.file.content.digest != currentDocument.file.content.digest)
              <filter id="document-created-filter">
                  <!-- Cover conditions when file changes AND when a new file is added without a previous
                  one existing already -->
                      #{previousDocument == null and currentDocument != null}


          Issue Links



              • Assignee:
                bbaron Bruce Baron
              • Votes:
                0 Vote for this issue
                1 Start watching this issue


                • Created: