XF 1.3 Forum Links

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?)
 
Back
Top Bottom