Page MenuHomePhabricator

Deprecated "getPrefixedText()" function still used in Special:Browse
Closed, ResolvedPublic

Description

The function SMWWikiPageValue::getPrefixedText(), which is deprecated, is still being used in two places in the "Special:Browse" page. This leads to PHP "notice" messages, which show up on the screen if the wiki's site has PHP set to "debug" mode. Thankfully, there's an easy fix; below is my patch for fixing the problem, using the replacement function, SMWWikiPageValue::getLongWikiText().

-Yaron

Index: specials/SearchTriple/SMW_SpecialBrowse.php

  • specials/SearchTriple/SMW_SpecialBrowse.php (revision 28756)

+++ specials/SearchTriple/SMW_SpecialBrowse.php (working copy)
@@ -135,7 +135,7 @@

        $html .= $skin->makeKnownLinkObj($subject, smwfT($subject, TRUE)) . ' ' . $subjectlink->getHTML($skin);
        if ($innercount<$subjectcount) $html .= ", \n";
} else {
  • $html .= '<a href="' . $skin->makeSpecialUrl('SearchByProperty', 'property=' . urlencode($result->getPrefixedText()) . '&value=' . urlencode($article->getPrefixedText())) . '">' . wfMsg("smw_browse_more") . "</a>\n";

+ $html .= '<a href="' . $skin->makeSpecialUrl('SearchByProperty', 'property=' . urlencode($result->getPrefixedText()) . '&value=' . urlencode($article->getLongWikiText())) . '">' . wfMsg("smw_browse_more") . "</a>\n";

      }
}
// replace the last two whitespaces in the relation name with

@@ -207,7 +207,7 @@

$count = count($cats);
foreach ($cats as $cat) {
      $count -= 1;
  • $browselink = SMWInfolink::newBrowsingLink('+', $cat->getPrefixedText());

+ $browselink = SMWInfolink::newBrowsingLink('+', $cat->getLongWikiText());

      $html .= $cat->getLongHTMLText($skin) . '&nbsp;' . $browselink->getHTML($skin);
      if ($count > 0) $html .= ", ";
}

Version: unspecified
Severity: normal

Details

Reference
bz12373

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:58 PM
bzimport set Reference to bz12373.
bzimport added a subscriber: Unknown Object (MLST).