Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-31132

Unable to create How-To articles via create template macro button when space key is an Integer

    XMLWordPrintable

Details

    Description

      Steps to Reproduce:

      1. Create a space and select an Integer for the space key
      2. Create a How-to article for the space.
      3. Navigate to the space, and go to How-To articles page.
      4. Try to create a How to article using the Add How-To Article button.

      Actual Results:

      The How-To article will not get created.

      Error in the logs:

      ERROR [http-8090-6] [jersey.spi.container.ContainerResponse] logException Mapped exception to response: 500 (Internal Server Error)
       -- url: /rest/create-dialog/1.0/content-blueprint/create-draft | userName: admin | referer: http://localhost:8090/display/1/How-To+Articles?src=spaceshortcut
      com.atlassian.confluence.plugins.createcontent.exceptions.ResourceException: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
      	at com.atlassian.confluence.plugins.createcontent.rest.ContentBlueprintResource.createDraft(ContentBlueprintResource.java:90)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	...
      	Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
      	at com.atlassian.confluence.plugins.createcontent.api.contextproviders.BlueprintContext.getSpaceKey(BlueprintContext.java:60)
      	at com.atlassian.confluence.plugins.confluence_kb_space_blueprint.ContentTemplateContextProvider.updateBlueprintContext(ContentTemplateContextProvider.java:46)
      	at com.atlassian.confluence.plugins.createcontent.api.contextproviders.AbstractBlueprintContextProvider.getContextMap(AbstractBlueprintContextProvider.java:26)
      

      Findings:

      • It is possible to create How-To article from the top bar Create > How-To Article.
      • This behavior will not be the same if the space key is not an Integer. Articles will be created successfully.

      Attachments

        1. create.png
          create.png
          14 kB
        2. one.png
          one.png
          18 kB

        Activity

          People

            agnes@atlassian.com Agnes Ro
            htoussi HosseinA
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: