Uploaded image for project: 'Hippo Site Toolkit 2'
  1. Hippo Site Toolkit 2
  2. HSTTWO-4560

PageModelApiMount instances always return null for #getChannel

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Top
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 13.1.1, 13.2.0
    • Component/s: None
    • Labels:
      None
    • Similar issues:
    • Processed by team:
      Turing
    • Sprint:
      Turing Sprint 206

      Description

      When this works fine in 13.2.0, we should even think about backporting this since in earlier versions this might be confusing. Also the commits/workaround in HSTTWO-4548 can then be undone (not the unit test, that one should keep working)

      When an hst:mount defines the property

      hst:pagemodelapi
      

      then the value of this property (assume it is 'resourceapi') , then an in memory mount with name 'resourceapi' will be appended below the mount defining the property 'hst:pagemodelapi'. This way, the normal website can be accessed via the explicit mount, and the pagemodelapi output via the in memory added mount. However, the PageModelApiMount impl always returns null for #getChannel. This might result in problems if for example an HstComponent accessed #getChannel and expects it not to be null or wants to serialize its value via the pagemodelapi output. Currently, the HstComponent should add a check something like

       Mount mount = requestContext.getResolvedMount().getMount();
              if (PAGE_MODEL_PIPELINE_NAME.equals(mount.getNamedPipeline()) && mount.getParent() != null) {
                  mount = mount.getParent();
              }
      

      This is error prone and shouldn't be needed. Instead, we page model api mount on #getChannel should just try to return the channel of the parent mount by default.

      Getting the parent mount can then be removed from

      • CmsComponentComponentWindowAttributeContributor
      • CmsComponentWindowResponseAppender
      • AbstractVirtualBeanPropertyWriter

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                aschrijvers Ard Schrijvers
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: