Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-11348

Getting infinite loops when using publication on domains that do not use the Domain doctype

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.6
    • Fix Version/s: 5.7.3
    • Component/s: Publishing

      Description

      When extending the Domain doctype, the publication feature doesn't work correctly because of a hard-coded reference to the "Domain" doctype in the PublishActionsBean:

      nuxeo-platform-publisher-web > AbstractPublishActions.java

      protected void getPathFragments(DocumentModel documentModel,
                  List<String> pathFragments) throws ClientException {
              String pathElementName = documentModel.getTitle();
              String translatedPathElement = resourcesAccessor.getMessages().get(
                      pathElementName);
              pathFragments.add(translatedPathElement);
              if ("Domain".equals(documentModel.getType())) {
                  return;
              }
      
              DocumentModel parentDocument;
              if (documentManager.hasPermission(documentModel.getParentRef(),
                      SecurityConstants.READ)) {
                  parentDocument = documentManager.getDocument(documentModel.getParentRef());
                  getPathFragments(parentDocument, pathFragments);
              }
          }
      

      This results in getting error pages at various places because of infinite loops.

      Suggested fix: Replace the hard-coded test with a more generic

      if (documentModel.getPathAsString().indexOf("/", 1) == -1) {
         return;
      }
      

      I will submit the patch as a pull request.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: