Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-26058

Journal Article - StructureIdException when adding a new structure using the API

    Details

      Description

      It is not possible to add a new JournalStructure from the API with a predefined structureID:
      The code:
      JournalStructureLocalServiceUtil.addStructure(userId, groupId, structureId , false, StringPool.BLANK, structureNames, structureDescriptions, xsd, serviceContext);
      will always throw a StructureIdException.
      This is because there is a bug in the method 'com.liferay.portlet.journal.service.impl.JournalStructureLocalServiceImpl.validateStructureId(String), it is missing an exlamation mark before the isNumber condition.

      protected void validateStructureId(String structureId)
      throws PortalException {

      if ((Validator.isNull(structureId)) ||
      -here-missing-!-->(Validator.isNumber(structureId)) ||
      (structureId.indexOf(CharPool.SPACE) != -1))

      { throw new StructureIdException(); }

      }

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                8 years, 22 weeks, 2 days ago

                Packages

                Version Package
                --Sprint 11/12
                6.2.0 CE M2