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

Japanese question and topics are Page Not Found

    XMLWordPrintable

Details

    Description

      NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      When we click a Japanese question or a topic, it becomes Page Not Found.
      topic

      question

      The problem is a slash in the last of the URL.

      The routing of the URL must be the following rule.

      1.1.43/cq-routes.xml
      <route to="/cq/questions.action?topicId={topicId}" from="/topics/{topicId: \d+}"/>
      <route to="/cq/questions.action?topicId={topicId}" from="/topics/{topicId: \d+}/{topicName}"/>
      ...
      <route to="/cq/viewquestion.action?id={questionId}" from="/{questionId: \d+}"/>
      <route to="/cq/viewquestion.action?id={questionId}" from="/{questionId: \d+}/{questionTitle}"/>
      <route to="/cq/viewquestion.action?id={questionId}" from="/{questionId: \d+}/{questionTitle}/{ignore:.*}"/>
      ...
      

      It was as follows in ver1.1.0.

      1.1.0/api/src/main/java/com/atlassian/confluence/plugins/questions/api/dto/QuestionDTO.java
      54        this.url = buildUrl();
      55    }
      ...
      128    private String buildUrl()
      129    {
      130        String sanitisedTitle = UrlUtils.sanitiseForUrl(title);
      131        return Strings.isNullOrEmpty(sanitisedTitle)
      132                ? String.format("/questions/%d", id)
      133                : String.format("/questions/%d/%s", id, sanitisedTitle.toLowerCase());
      134    }
      

      In ver1.1.43, the last of the URL gets a slash depending on a result of sanitisedTitle.

      1.1.43/com/atlassian/confluence/plugins/questions/web/QuestionRouter.java
      public String createViewRoute(Question question)
      {
        String sanitisedTitle = UrlUtils.sanitiseForUrl(question.getTitle());
        return String.format("%s/%d/%s", new Object[] { getPrefix(question.getSpace()), Long.valueOf(question.getId()), sanitisedTitle.toLowerCase() });
      }
      
      1.1.43/com/atlassian/confluence/plugins/questions/web/TopicRouter.java
      public String createViewRoute(Question question)
      {
        String sanitisedTitle = UrlUtils.sanitiseForUrl(question.getTitle());
        return String.format("%s/%d/%s", new Object[] { getPrefix(question.getSpace()), Long.valueOf(question.getId()), sanitisedTitle.toLowerCase() });
      }
      

      This problem occurs in less than Confluence 5.4.x.
      This problem does not occur in higher than Confluence 5.5.
      Possibly it may be difference in Version of Tomcat.

      This problem influences all questions and topics except ASCII.

      Workaround

      Append any characters behind the URL.
      For example:
      Original URL: http://www.example.com/confluence/display/QUES/questions/4063265/
      Fixed URL 1: http://www.example.com/confluence/display/QUES/questions/4063265/-
      Fixed URL 2: http://www.example.com/confluence/display/QUES/questions/4063265/~
      Fixed URL 3: http://www.example.com/confluence/display/QUES/questions/4063265/abc

      Attachments

        1. image2014-12-19 10-26-51.png
          image2014-12-19 10-26-51.png
          87 kB
        2. image2014-12-19 10-27-32.png
          image2014-12-19 10-27-32.png
          64 kB
        3. image2014-12-19 10-30-27.png
          image2014-12-19 10-30-27.png
          135 kB
        4. image2014-12-19 10-30-32.png
          image2014-12-19 10-30-32.png
          64 kB

        Issue Links

          Activity

            People

              dluong Duy Truong Luong
              3da02f17cbee Ricksoft Co., Ltd.
              Votes:
              7 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: