r39956 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39955‎ | r39956 | r39957 >
Date:16:48, 25 August 2008
Author:yaron
Status:old
Tags:
Comment:
Fixed handling of category autocompletion with substring
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php
@@ -9,7 +9,7 @@
1010
1111 if ( !defined( 'MEDIAWIKI' ) ) die();
1212
13 -define('SF_VERSION','1.2.9');
 13+define('SF_VERSION','1.2.10');
1414
1515 $wgExtensionCredits['specialpage'][]= array(
1616 'name' => 'Semantic Forms',
@@ -420,9 +420,8 @@
421421 function sffEmbeddedEditForm($action, $article) {
422422 global $sfgIP;
423423
424 - // for some reason, the code calling the 'UnknownAction' hook wants
425 - // "true" if the hook failed, and "false" otherwise... this is
426 - // probably a bug, but we'll just work with it
 424+ // return "true" if the call failed (meaning, pass on handling of
 425+ // the hook to others), and "false" otherwise
427426 if ($action != 'formedit') {
428427 return true;
429428 }
@@ -636,7 +635,8 @@
637636 $substring = str_replace(' ', '_', strtolower($substring));
638637 $substring = str_replace('_', '\_', $substring);
639638 $substring = str_replace("'", "\'", $substring);
640 - $conditions = 'cl_to = '. $db->addQuotes($category) . " AND (LOWER(page_title) LIKE '" . $substring . "%' OR LOWER(page_title) LIKE '%\_" . $substring . "%')";
 639+ $conditions = 'cl_to = '. $db->addQuotes($category) . " AND (LOWER(page_title) LIKE '" . $substring . "%' OR LOWER(page_title) LIKE '%\_" . $substring . "%' OR page_namespace = " . NS_CATEGORY . ")";
 640+
641641 } else {
642642 $conditions = 'cl_to = '. $db->addQuotes($category);
643643 }

Status & tagging log