Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-12768

when processing content actions, a path with an append and a later delete action always is applied

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Normal
    • Resolution: Unresolved
    • 5.0.0
    • None
    • repository
    • None
    • 1
    • Platform 167, Platform 168, Platform 169

    Description

      The current code in ConfigurationContentService#apply(ModuleImpl, ConfigurationModel, Session, boolean) contains the following bug:

      • it first collects all new actions
      • then it processes all deletes
      • then it applies all appends/reloads

      If you feed it the following action list:

      action-lists:
      - 1.0:
        /path: reload
      - 1.1:
        /path: delete
      

      It will first delete the path, and then reload it. There is no logic (yet) to remove reloads if it the path is deleted in a later action. A warning should be issued that the action in 1.0 is not processed and should be cleaned up.

      The same logic (and bug) is currently duplicated in DefinitionMergeService#applyContentDefinitions

      When refactoring, I'd advise to merge #collectNewActions and #getSortedDefinitions into one method that returns a list of actions to process, already correctly sorted in correct processing order.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              oscholten Oscar Scholten (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: