Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-34348

LegacyAdminLinkFactory uses ServletActionContext to get Request. It should use ExecutingHttpRequest.get()

    XMLWordPrintable

Details

    • Severity 3 - Minor
    • Hide
      Atlassian Update – 06 December 2017

      Hi everyone,

      We have recently reviewed this issue and the overall interest in the problem. As the issue hasn't collect votes, watchers, comments, or support cases from many customers during its lifetime, it's very low on our priority list, and will not be fixed in the foreseeable future. That's why we've decided to resolve it as Time Out.

      Although we're aware the issue is still important to those of you who were involved in the conversations around it, we want to be clear in managing your expectations. The Jira team is focusing on issues that have broad impact and high value, reflected by the number of comments, votes, support cases, and customers interested. Please consult the Atlassian Bugfix Policy for more details.

      We understand how disappointing this decision may be, but we hope you'll appreciate our transparent approach and communication.
      Atlassian will continue to watch this issue for further updates, so please feel free to share your thoughts in the comments.
      Thank you,
      Ignat Alexeyenko
      Jira Bugmaster

      Show
      Atlassian Update – 06 December 2017 Hi everyone, We have recently reviewed this issue and the overall interest in the problem. As the issue hasn't collect votes, watchers, comments, or support cases from many customers during its lifetime, it's very low on our priority list, and will not be fixed in the foreseeable future. That's why we've decided to resolve it as Time Out . Although we're aware the issue is still important to those of you who were involved in the conversations around it, we want to be clear in managing your expectations. The Jira team is focusing on issues that have broad impact and high value, reflected by the number of comments, votes, support cases, and customers interested. Please consult the Atlassian Bugfix Policy for more details. We understand how disappointing this decision may be, but we hope you'll appreciate our transparent approach and communication. Atlassian will continue to watch this issue for further updates, so please feel free to share your thoughts in the comments. Thank you, Ignat Alexeyenko Jira Bugmaster

    Description

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

      In LegacyAdminLinkFactory we have this code:

       @Override
          public List<SimpleLink> getLinks(User user, Map<String, Object> params)
          {
              final JiraHelper helper = new JiraHelper(ServletActionContext.getRequest());
              final List<SimpleLink> ret = new ArrayList<SimpleLink>();
      
              final List<SimpleLinkSection> sections = simpleLinkManager.getSectionsForLocation(SYSTEM_ADMIN_LOCATION, user, helper);
              for (SimpleLinkSection section : sections)
              {
                  ret.addAll(simpleLinkManager.getLinksForSection(SYSTEM_ADMIN_LOCATION + "/" + section.getId(), user, helper));
              }
              return ret;
          }
      

      This causes problems when using admin quick search g + g (which goes through REST) with legacy links:

      [INFO] [talledLocalContainer] 2013-08-16 13:17:46,204 http-bio-2990-exec-40 DEBUG admin 797x2281x1 h451kq 0:0:0:0:0:0:0:1%0 /rest/adminquicksearch/latest/links/default [jira.plugin.webfragment.DefaultSimpleLinkManager] RuntimeException converting item 'com.atlassian.jira.ext.anyfooter:anyfooter-config-link' to Simple link. This link will be skipped.
      [INFO] [talledLocalContainer] java.lang.NullPointerException
      [INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.model.DefaultWebLink.getDisplayableUrl(DefaultWebLink.java:47)
      [INFO] [talledLocalContainer] 	at com.atlassian.jira.plugin.webfragment.model.JiraWebLink.getDisplayableUrl(JiraWebLink.java:39)
      [INFO] [talledLocalContainer] 	at com.atlassian.jira.plugin.webfragment.DefaultSimpleLinkManager.convertWebItemToSimpleLink(DefaultSimpleLinkManager.java:286)
      [INFO] [talledLocalContainer] 	at com.atlassian.jira.plugin.webfragment.DefaultSimpleLinkManager.getLinks(DefaultSimpleLinkManager.java:191)
      [INFO] [talledLocalContainer] 	at com.atlassian.jira.plugin.webfragment.DefaultSimpleLinkManager.getLinksForSection(DefaultSimpleLinkManager.java:132)
      [INFO] [talledLocalContainer] 	at com.atlassian.jira.admin.LegacyAdminLinkFactory.getLinks(LegacyAdminLinkFactory.java:46)
      [INFO] [talledLocalContainer] 	at com.atlassian.jira.plugin.webfragment.DefaultSimpleLinkManager.getLinks(DefaultSimpleLinkManager.java:204)
      [INFO] [talledLocalContainer] 	at com.atlassian.jira.plugin.webfragment.DefaultSimpleLinkManager.getLinksForSection(DefaultSimpleLinkManager.java:132)
      [INFO] [talledLocalContainer] 	at sun.reflect.GeneratedMethodAccessor281.invoke(Unknown Source)
      [INFO] [talledLocalContainer] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Delegati
      

      It should use ExcecutingHttpRequest.get() to get the request which also works for REST (ServletActionContext only works for webwork requests).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              andreask@atlassian.com Andreas Knecht (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: