Create Confluence Questions Topic with Special Character fails

XMLWordPrintable

    • 3
    • Severity 3 - Minor
    • 0

      Summary

      Creating a Confluence Questions topic with special characters fails with:

      • An unknown server error has occurred.

      Environment

      • Confluence 7.4.0
      • Questions for Confluence 2.7.20

      Steps to Reproduce

      1. Install Questions for Confluence from Marketplace
      2. Go to the Topics tab
        Enter a new topic with Special Characters in it
        • For example: test.topic
      3. Click Next and Save

      Expected Results

      A new topic is created

      Actual Results

      1. An error occurs:
        An unknown server error has occurred.
        

      An error in atlassian-confluence.log occurs:

      java.lang.IllegalArgumentException: Invalid label 'test.topic'
      	at com.atlassian.confluence.labels.DefaultLabelManager.validateLabel(DefaultLabelManager.java:672)
      	at com.atlassian.confluence.labels.DefaultLabelManager.createLabel(DefaultLabelManager.java:645)
      	at com.atlassian.confluence.labels.CachingLabelManager.createLabel(CachingLabelManager.java:386)
      ...
      	at com.atlassian.confluence.plugins.questions.contenttype.repository.QuestionsLabelManager.createLabel(QuestionsLabelManager.java:24)
      	at com.atlassian.confluence.plugins.questions.contenttype.repository.LabelTopicRepository.create(LabelTopicRepository.java:132)
      	at com.atlassian.confluence.plugins.questions.contenttype.repository.LabelTopicRepository.create(LabelTopicRepository.java:126)
      	at com.atlassian.confluence.plugins.questions.service.TopicServiceImpl.createTopic(TopicServiceImpl.java:132)
      ...
      

      Root Cause

      A Topic follows the validation for a label in which these characters are not permitted:

      LabelParser.java
          private static final SortedSet<Character> INVALID_LABEL_CHARACTERS = ImmutableSortedSet.of(
                  ':', ';', ',', '.', ' ', '?', '&', '[', ']', '(', ')', '#', '^', '*', '@', '!', '<', '>'
          );
      

      The label validation error is shown when creating a "Label":

      It appears the above informative exception when creating a label is not propagated to Confluence Questions add-on when creating a Topic.

      Resolution

      Change the Topic name so it does not contain one of the above mentioned special characters.

        1. label_validation_error.png
          label_validation_error.png
          64 kB
        2. test.topic.png
          test.topic.png
          155 kB

            Assignee:
            Unassigned
            Reporter:
            Eric L
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: