Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-2348

Pages with request parameters break in preview mode

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 5.1.2, 5.2
    • None
    • None
    • None

      When a link with request parameters is clicked in the page editor the url is suffixed with ?mgnlChannel=desktop&mgnlPreview=true. It always starts with a question mark. If there's already request parameters present in the url this will fail making ?mgnlChannel=desktop part of the value of the last request parameter already in the url.

      Steps to reproduce:

      In firefox:

      • Start the pages app
      • Double-click demo-features
      • Click Special templates
      • Click Search Result in the left navigation
      • Switch to preview mode
      • Enter 'a' in the search field and press enter
      • A search result is presented with 21 pages
      • Click to change to page 2
      • The search result is now empty

      The reason is that the currentPage parameter sent to the server is: 2?mgnlChannel=desktop

      The full url is:

      http://localhost:8080/magnoliaAuthor/demo-features/special-templates/search-result.html?queryStr=a&currentPage=2?mgnlChannel=desktop&mgnlPreview=true

      I believe the problem to be in PageEditorConnetor#init, in this block:

              eventBus.addHandler(FrameNavigationEvent.TYPE, new FrameNavigationEventHandler() {
                  @Override
                  public void onFrameUrlChanged(FrameNavigationEvent frameUrlChangedEvent) {
                      final String platformId = getState().parameters.getPlatformType().getId();
                      final boolean isPreview = getState().parameters.isPreview();
                      final String queryString = "?mgnlChannel=" + platformId + "&mgnlPreview=" + isPreview;
                      view.setUrl(frameUrlChangedEvent.getPath() + queryString);
                  }
              });
      

        Acceptance criteria

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

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD