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

jcr: add initilization method for wrapper cloning

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Neutral
    • 4.5
    • None
    • core
    • None

    Description

      We clone Node wrappers both in DelegateNodeWrapper.deepUnwrap() and in ChildWrappingNodeWrapper.wrapNode(). In both instances we simply change the wrapped node and trust the subclass to do additional setup as required. However changing the wrapped node directly can be problematic depending on what the subclass wants to do.

      For instance, LazyNodeWrapper keeps its node reference locally in a field so this doesn't get updated during cloning.

      DelegateNodeWrapper should have a method:

      protected void initClone(Node newNode)
      

      or similar to allow subclasses to act appropriately on cloning.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              tmattsson Tobias Mattsson
              tmattsson Tobias Mattsson
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD