SiT! Bugs

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001968SiT!portalpublic2015-06-15 06:292015-11-01 12:45
Reporterrockell 
Assigned Topaulh 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformLinuxOSLinuxOS Version2.6+later
Product Version3.67 LTS 
Target VersionFixed in VersionCurrent GIT 
Summary0001968: Incorrect software name appears above Title in portal knowledgebase
DescriptionThe name for the first record in the software table appears for all articles.
Steps To ReproduceAdd a knowledge base item with a different skill from the first record in the software table. When you view it in the portal it will have the name of the first record.
Additional InformationThe query in kb.php is incorrect. I changed mine to this and it now works as expected. i am not sure what the code inside the if statement does so i left it as-is. The first commented query was already commented, the second commented query was in the delivered code but was incorrect. The query below my initials works for me and i have tried it using all the options available on the page.

$filter = array('start' => $start, 'view' => $view);

// $sql = "SELECT k.*, s.name FROM `{$dbKBArticles}` AS k,
// $dbKBSoftware,
// `{$dbSoftware}` as s
// WHERE ((k.docid = kbs.docid AND kbs.softwareid = s.id) OR 1=1) AND k.distribution = 'public' ";
// $sql = "
// SELECT k.*, s.name FROM `{$dbKBArticles}` AS k,
// LEFT OUTER JOIN `$dbKBSoftware`, `{$dbSoftware}`
// ON k.docid = kbs.docid AND kbs.softwareid = s.id ";


//$sql = "SELECT k.*, s.name FROM `{$dbKBArticles}` AS k, `{$dbSoftware}` as s ";
//$sql .= "LEFT OUTER JOIN `{$dbKBSoftware}` as kbs ";
//$sql .= "ON kbs.softwareid=s.id ";
//$sql .= "WHERE (k.docid = kbs.docid OR 1=1) AND k.distribution='public' ";

//CR - 2015-06-15 Corrected query so it brings up the right name
$sql = "SELECT k.*, s.name FROM `{$dbKBArticles}` AS k inner join `{$dbKBSoftware}` as ks inner join `{$dbSoftware}` as s ";
$sql .= "ON ks.docid=k.docid and s.id=ks.softwareid ";
$sql .= "WHERE k.distribution='public' ";

if ($CONFIG['portal_kb_enabled'] != 'Public')
{
    if ($view != 'all')
    {
        $softwares = contract_software();
        $sql .= "AND (1=1 ";
        if (is_array($softwares))
        {
            foreach ($softwares AS $software)
            {
                $sql .= "OR kbs.softwareid={$software} ";
            }
        }
        $sql .= ")";

        echo "<p class='info'>{$strShowingOnlyRelevantArticles} - ";
        echo "<a href='{$_SERVER['PHP_SELF']}?view=all'>{$strShowAll}</a>

";
    }
    else
    {
        echo "<p class='info'>{$strShowingAllArticles} - ";
        echo "<a href='{$_SERVER['PHP_SELF']}'>{$strShowOnlyRelevant}</a>

";
    }
}
$sql .= "GROUP BY k.docid ";
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
User avatar (0004983)
paulh (administrator)
2015-11-01 12:33

Thanks for this, reproduced in current git
User avatar (0004984)
paulh (administrator)
2015-11-01 12:45

4570303eb2853c70dde208b777aa3f097c5b6e9d fixes

- Issue History
Date Modified Username Field Change
2015-06-15 06:29 rockell New Issue
2015-11-01 12:33 paulh Note Added: 0004983
2015-11-01 12:33 paulh Assigned To => paulh
2015-11-01 12:33 paulh Status new => confirmed
2015-11-01 12:45 paulh Note Added: 0004984
2015-11-01 12:45 paulh Status confirmed => resolved
2015-11-01 12:45 paulh Resolution open => fixed
2015-11-01 12:45 paulh Fixed in Version => Current GIT


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker