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

Remove assumptions on lifecycle transitions when automatically versioning a document

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 9.2
    • Fix Version/s: 9.3
    • Component/s: Core

      Description

      The new Versioning policy creates a lot of versions. So for example, everytime a different user modifies a document, a version is created.

      But the code that versions also decides, for whatever reason, to change the lifecycle state. So, if the document is approved or obsolete, it follows the backToProject transition. See StandardVersioningService#followTransitionByOption:

          protected void followTransitionByOption(Document doc, VersioningOption option) {
              String lifecycleState = doc.getLifeCycleState();
              if (APPROVED_STATE.equals(lifecycleState) || OBSOLETE_STATE.equals(lifecycleState)) {
                  doc.followTransition(BACK_TO_PROJECT_TRANSITION);
              }
          }
      

      Big problem here: If this transition does not exist, a modification fails, transation is rolled back, and no change is performed.

      We do have several projects where the lifecycle policy is not the default one but still use the commonly approved or obsolete states (DAM-Template demo and all demos derived form this one for example).

      So: This code should either:

      • Check if (1) The policy is "default", and if not, do nothing, if yes continue
      • And+or Check the backToProject transition is available and follows it only if it is the case, do nothing if it's not
      • Surround with a try...catch}
      • Remove this and don't change the state
      • Allow for configuring the behavior (transitions, starting states, etc.)

      See also NXP-19679

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                7 Vote for this issue
                Watchers:
                5 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 - 2 hours
                  2h