Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-22519

Duplicating a content version results in an empty draft if maximum versions is reached

    Details

      Description

      Content versions in eZ Publish are listed by creation date, and we can see all existing versions of an object under /content/history/<object_id>

      We can also define a maximum number of versions for all content objects, or for each content object of a given content class.
      The issue is not really the number of versions we allow, but the way eZ Publish creates new version: it checks the number of existing versions, compares to the maximum allowed version number, and if the maximum version number has been reached already it removes the oldest one. And after that, it will proceed and create a new version as a draft.
      So far so good.
      This gives us a huge problem if we need to copy the oldest version and we already reached the maximum number of versions.
      In that case, the oldest version will be removed, and an empty draft will created, instead of a copy of the desired version.


      Steps to reproduce:

      1. Create one folder from the administration backed and send it to publish
      2. Edit the same folder 4 more times, in order to get 5 versions (which is the maximum by default)
      3. Click the "Manage versions" button
      4. Copy the oldest version of your folder

      You should get an empty draft, which is wrong.

        Issue Links

          Activity

          Ricardo Correia (Inactive) created issue -
          Ricardo Correia (Inactive) made changes -
          Field Original Value New Value
          Description Content versions in eZ Publish are listed by creation date, and we can see all existing versions of an object under {{/content/history/<object_id>}}

          We can also define a maximum number of versions for all content objects, or for each content object of a given content class.
          The issue is not really the number of versions we allow, but the way eZ Publish creates new version: it checks the number of existing versions, compares to the maximum allowed version number, and if the maximum version number has been reached already it removes the oldest one. And after that, it will proceed and create a new version as a draft.
          So far so good.
          This gives us a huge problem if we need to copy the oldest version and we already reached the maximum number of versions.
          In that case, the oldest version will be removed, and an empty draft will created, instead of a copy of the desired version.
           
          ----

          **Steps to reproduce:**

          # Create one folder from the administration backed and send it to publish
          # Edit the same folder 4 more times, in order to get 5 versions (which is the maximum by default)
          # Click the "Manage versions" button
          # Copy the oldest version of your folder

          You should get an empty draft, which is wrong.
          Content versions in eZ Publish are listed by creation date, and we can see all existing versions of an object under {{/content/history/<object_id>}}

          We can also define a maximum number of versions for all content objects, or for each content object of a given content class.
          The issue is not really the number of versions we allow, but the way eZ Publish creates new version: it checks the number of existing versions, compares to the maximum allowed version number, and if the maximum version number has been reached already it removes the oldest one. And after that, it will proceed and create a new version as a draft.
          So far so good.
          This gives us a huge problem if we need to copy the oldest version and we already reached the maximum number of versions.
          In that case, the oldest version will be removed, and an empty draft will created, instead of a copy of the desired version.
           
          ----

          *Steps to reproduce:*

          # Create one folder from the administration backed and send it to publish
          # Edit the same folder 4 more times, in order to get 5 versions (which is the maximum by default)
          # Click the "Manage versions" button
          # Copy the oldest version of your folder

          You should get an empty draft, which is wrong.
          Ricardo Correia (Inactive) made changes -
          Status Open [ 1 ] Confirmed [ 10037 ]
          André Rømcke made changes -
          Status Confirmed [ 10037 ] InputQ [ 10001 ]
          Yannick Roger (Inactive) logged work - 27/Mar/14 2:44 PM
          • Time Spent:
            3 hours
             

            .

          Yannick Roger (Inactive) made changes -
          Status InputQ [ 10001 ] Development [ 3 ]
          Assignee Yannick Roger [ yannick.roger@ez.no ]
          Yannick Roger (Inactive) made changes -
          Affects Version/s 5.2 [ 12582 ]
          Affects Version/s 5.1 [ 11280 ]
          Affects Version/s 5.0 [ 10300 ]
          Affects Version/s 5.3-dev [ 12979 ]
          Yannick Roger (Inactive) logged work - 28/Mar/14 1:44 PM
          • Time Spent:
            3 hours
             
            <No comment>
          Yannick Roger (Inactive) made changes -
          Remote Link This issue links to "PR (Web Link)" [ 13911 ]
          Yannick Roger (Inactive) made changes -
          Remaining Estimate 0 minutes [ 0 ]
          Time Spent 3 hours [ 10800 ]
          Worklog Id 47166 [ 47166 ]
          Yannick Roger (Inactive) made changes -
          Status Development [ 3 ] Development review [ 10006 ]
          Yannick Roger (Inactive) made changes -
          Time Spent 3 hours [ 10800 ] 6 hours [ 21600 ]
          Worklog Id 47167 [ 47167 ]
          Show
          Yannick Roger (Inactive) added a comment - - edited Fixed in master: https://github.com/ezsystems/ezpublish-legacy/commit/7b7c1519f0184e7779bc15df5ae29c2bbf745257 https://github.com/ezsystems/ezpublish-legacy/commit/7b16eeac20478130bfdd3d6952c2643f124f9620
          Yannick Roger (Inactive) made changes -
          Status Development review [ 10006 ] Development Review done [ 10028 ]
          Fix Version/s 4.7 Maintenance [ 12583 ]
          Fix Version/s 5.0 Maintenance [ 11287 ]
          Fix Version/s 5.3 [ 11282 ]
          Fix Version/s 5.1 Maintenance [ 12301 ]
          Fix Version/s 5.2 Maintenance [ 12782 ]
          Yannick Roger (Inactive) made changes -
          Status Development Review done [ 10028 ] Documentation done [ 10011 ]
          Pedro Resende (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Assignee Yannick Roger [ yannick.roger@ez.no ] Pedro Resende [ pedro.resende@ez.no ]
          Pedro Resende (Inactive) made changes -
          Rank Ranked higher
          Pedro Resende (Inactive) made changes -
          Flagged Impediment [ 10000 ]
          Pedro Resende (Inactive) made changes -
          Status QA [ 10008 ] InputQ [ 10001 ]
          Assignee Pedro Resende [ pedro.resende@ez.no ]
          Pedro Resende (Inactive) logged work - 31/Mar/14 5:54 PM
          • Time Spent:
            3 hours, 30 minutes
             

            Worked on story

          Pedro Resende (Inactive) made changes -
          Time Spent 6 hours [ 21600 ] 1 day, 1 hour, 30 minutes [ 34200 ]
          Worklog Id 47220 [ 47220 ]
          Yannick Roger (Inactive) made changes -
          Status InputQ [ 10001 ] Development [ 3 ]
          Assignee Yannick Roger [ yannick.roger@ez.no ]
          Yannick Roger (Inactive) made changes -
          Flagged Impediment [ 10000 ]
          Yannick Roger (Inactive) made changes -
          Remote Link This issue links to "PR for the regression (Web Link)" [ 14003 ]
          Yannick Roger (Inactive) made changes -
          Status Development [ 3 ] Development review [ 10006 ]
          Yannick Roger (Inactive) made changes -
          Status Development review [ 10006 ] Development Review done [ 10028 ]
          Yannick Roger (Inactive) made changes -
          Status Development Review done [ 10028 ] Documentation done [ 10011 ]
          Eduardo Fernandes (Inactive) made changes -
          Assignee Yannick Roger [ yannick.roger@ez.no ] Eduardo Fernandes [ eduardo.fernandes@ez.no ]
          Paulo Nunes (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Assignee Eduardo Fernandes [ eduardo.fernandes@ez.no ] Paulo Nunes [ paulo.nunes@ez.no ]
          Paulo Nunes (Inactive) made changes -
          Assignee Paulo Nunes [ paulo.nunes@ez.no ] Eduardo Fernandes [ eduardo.fernandes@ez.no ]
          Hide
          Eduardo Fernandes (Inactive) added a comment -

          QA Approved

          Show
          Eduardo Fernandes (Inactive) added a comment - QA Approved
          Eduardo Fernandes (Inactive) made changes -
          Assignee Eduardo Fernandes [ eduardo.fernandes@ez.no ]
          Status QA [ 10008 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          André Rømcke made changes -
          Workflow eZ Engineering Scrumban Workflow [ 62415 ] EZ* Development Workflow [ 84864 ]
          Alex Schuster made changes -
          Workflow EZ* Development Workflow [ 84864 ] EZEE Development Workflow [ 123568 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Confirmed Confirmed
          3m 39s 1 ricardo.correia@ez.no 21/Mar/14 5:28 PM
          Confirmed Confirmed InputQ InputQ
          2d 16h 44m 1 André Rømcke 24/Mar/14 10:12 AM
          QA QA InputQ InputQ
          3h 33m 1 pedro.resende@ez.no 31/Mar/14 5:05 PM
          InputQ InputQ Development Development
          4d 10m 2 yannick.roger@ez.no 01/Apr/14 11:13 AM
          Development Development Development Review Development Review
          1d 4h 50m 2 yannick.roger@ez.no 01/Apr/14 6:34 PM
          Development Review Development Review Development Review done Development Review done
          3d 19h 1m 2 yannick.roger@ez.no 02/Apr/14 5:05 PM
          Development Review done Development Review done Documentation Review done Documentation Review done
          34s 2 yannick.roger@ez.no 02/Apr/14 5:05 PM
          Documentation Review done Documentation Review done QA QA
          2h 33m 2 Paulo Nunes 02/Apr/14 5:22 PM
          QA QA Closed Closed
          19h 16m 1 eduardo.fernandes@ez.no 03/Apr/14 12:38 PM

            People

            • Assignee:
              Unassigned
              Reporter:
              Ricardo Correia (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 1 hour, 30 minutes
                1d 1h 30m