1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.3 Forum Links

Discussion in 'XenForo Questions and Support' started by xf_phantom, Feb 12, 2014.

  1. xf_phantom

    xf_phantom Well-Known Member

    After http://xenforo.com/community/threads/getting-the-forum-number-from-the-uri.68377/ i noticed the first time, that the forum urls doesn't include the id sometimes

    e.g.
    http://xenforo.com/community/forums/announcements/ => no id
    http://xenforo.com/community/forums/have-you-seen/ => no id
    http://xenforo.com/community/link-forums/frequently-asked-questions.19/ => id
    http://xenforo.com/community/forums/xenforo-pre-sales-questions.5/ => id

    http://xenforo.com/community/forums/bugs/ => no id
    http://xenforo.com/community/forums/future-fix-bug-reports.43/ => id



    Inside XenForo_Route_Prefix_Forums
    PHP:
    public function buildLink($originalPrefix$outputPrefix$action$extension$data, array &$extraParams)
       {
         
    $action XenForo_Link::getPageNumberAsAction($action$extraParams);

         if (
    is_array($data) && !empty($data['node_name']))
         {
           return 
    XenForo_Link::buildBasicLinkWithStringParam($outputPrefix$action$extension$data'node_name');
         }
         else
         {
           
    // for situations such as an array with thread and node info
           
    if (isset($data['node_title']))
           {
             
    $data['title'] = $data['node_title'];
           }

           return 
    XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix$action$extension$data'node_id''title');
         }
       }
    i noticed

    PHP:
    if (is_array($data) && !empty($data['node_name']))
         {
           return 
    XenForo_Link::buildBasicLinkWithStringParam($outputPrefix$action$extension$data'node_name');
         }
         else
         {
           
    // for situations such as an array with thread and node info
           
    if (isset($data['node_title']))
           {
             
    $data['title'] = $data['node_title'];
           }
    but i can't find a logical reason, why the node_name is set sometimes and sometimes not...

    Bug?
    Feature/ As Designed (if yes, what's the reason for this inconstancy?)
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    The ones with IDs don't have a URL portion set.

    upload_2014-2-12_14-41-30.png
     
    xf_phantom likes this.

Share This Page