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

XPage 'Publish (request)' option not enabled by requestPublication hint

    XMLWordPrintable

Details

    • Flagged
    • Client Service Team
    • Puma Sprint 264

    Description

      On the XPages menu, the "Publish (request)" action is not enabled if the workflow hints() call has:

      • publishBranch=false
      • requestPublication=true

      This is due to two else if's instead of just a second if in org.hippoecm.hst.pagecomposer.jaxrs.services.component.XPageContextFactory

              if (scheduledRequest == null) {
                  final boolean pageIsUnlocked = StringUtils.isBlank(xPageContext.getLockedBy());
                  if (hints.containsKey("publishBranch")) {
                      xPageContext.setPublishable(TRUE.equals(hints.get("publishBranch")) && pageIsUnlocked);
                  } *else* if (hints.containsKey("requestPublication")) {
                      xPageContext.setRequestPublication(TRUE.equals(hints.get("requestPublication")));
                  }
      
                  if (hints.containsKey("depublishBranch")) {
                      xPageContext.setUnpublishable(TRUE.equals(hints.get("depublishBranch")) && pageIsUnlocked);
                  } *else* if (hints.containsKey("requestDepublication")) {
                      xPageContext.setRequestDepublication(TRUE.equals(hints.get("requestDepublication")));
                  }
              } 
      

      Similar case with "depublishBranch"/"requestDepublication".

      Suggested solution:
      Just remove the else!

      Attachments

        Activity

          People

            abogaart Arthur Bogaart
            jhoffman Jeroen Hoffman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: