Extension talk:CategorySuggest/Archive

Internationalisation German (Done)
$messages['en']['categorysuggest-title']       = 'KATEGORIE VERGABE'; $messages['en']['categorysuggest-subtitle']    = 'Bitte fügen sie den Namen der Kategorie ein.'; $messages['en']['categorysuggest-boxlabel']    = 'Kategorien'; $messages['en']['categorysuggest-taglabel']    = 'Beliebte Kategorie';


 * This is now available in the master branch on GitHub --Adamfranco (talk) 20:21, 26 March 2013 (UTC)


 * There is one typo. The correct sentence for 'categorysuggest-subtitle' is: 'Bitte fügen Sie den Namen der Kategorie ein.' (with a capital "S") --95.208.117.3 00:53, 9 August 2013 (UTC)


 * Typo now fixed. Adamfranco (talk) 15:35, 10 October 2014 (UTC)

Taking over maintenance of this extension (2012-08-01)
Dear CategorySuggest community,

Since it seems as though this extension has been abandoned and users are having trouble with the published release (marking the extension as broken), I'm volunteering to take over maintenance of this extension and have updated the main extension page to point to the new release I've hosted on GitHub. I don't wish this to be a hostile take-over, but rather a shift to help keep updates to the extension going. I'm happy to hand back the reins to Andreas or anyone else who wishes to carry the torch, but I'd hate to see this extension die. The 1.2 release I posted on GitHub works in MediaWiki-1.18. I welcome patches and bug reports that can help continue to make this extension valuable -- please submit them to the issue tracker on GitHub.

Best, Adam --Adamfranco (talk) 15:29, 1 August 2012 (UTC)

Thanks Adam for taking on the maintenance! --Lindele (talk) 16:25, 1 August 2012 (UTC)

Fixed version available for MediaWiki 1.18 (2012-02-23) (Done)
Hello all, I have updated this extension to support MediaWiki 1.18 and added a few usability improvements:


 * automatic delimiter insertion
 * keyboard access for selecting from search results
 * fixed case-insensitivity in search

https://github.com/middlebury/CategorySuggest

I'm not sure what the policy on taking over projects is, but I'd be happy to help maintain improvements to this extension (using Github for source and issue-tracking) if the original author has abandoned this project. Feel free to contact me at afranco@middlebury.edu. --Adamfranco (talk) 16:19, 23 February 2012 (UTC)


 * Hi! this works great! i would suggest making sure the first letter is capitalized. then it fits in perfectly with the Select Category extension


 * I'm running this extension on MW1.18 . I get a bug whereby the category suggester works after typing the first letter, but suggests nothing at all after the second (or more) letter. Any thoughts? Maximilianklein (talk) 00:16, 19 April 2012 (UTC)


 * Follow up posted on the GitHub issue. --Adamfranco (talk) 18:15, 25 April 2012 (UTC)
 * Have no github account, but want to share the solution ;-) As adamfranco already pointed ou this has to do with the field cl_to from table categorylinks beeing varbinary now, and not varchar as before. To use the MySQL ucase-function the content of the field has to be converted. Change line 68 in file CategorySuggest.php to  --217.19.182.9 13:19, 18 September 2012 (UTC)

it does not work on PHP 5.3 and newer
It works with PHP 5.2. But with PHP 5.3 and newer - no matter which version of MediaWiki I am using - I get this error:

Detected bug in an extension! Hook fnCategorySuggestOutputHook has invalid call signature; Parameter 2 to fnCategorySuggestOutputHook expected to be a reference, value given

--> Can be fixed when you modify OutputPage.php from $parserOutput to &$parserOutput and EditPage.php (Line 877) $this to &$this


 * Better do not edit Core files. Instead [mailto:blog@adamfranco.com write Adam Franco a mail], tell him about the error message and ask him to provide a fix.


 * It seems like this page contains helpful information on the error. If Adam removes the "&" in front of the second parameter of the function call, that should solve the issue. --88.130.96.183 11:43, 2 August 2013 (UTC)

Strange behavior in Mediawiki 1.12
For Mediawiki
 * Product 	Version
 * MediaWiki 	1.12.0
 * PHP 	5.2.5 (apache2handler)
 * MySQL 	5.0.51a

When I edit an article, category frame is missing (see below)

Then after a showpreview, it's OK

Have you an idea how the issue could be fixed ? Thanks in advance

CKL

I get the same problem in MediaWiki 1.13.2 using CategorySuggest version 1.1

KMc

Remove space on a blank line
CategorySuggest extension removes spaces in a blank line.
 * This is for example annoying to display source code
 * For example

Source code Line 1 Source code Line 2 (1 Space at the beginning of the line) Source code Line 4

will give Source code Line 1 Source code Line 2

Source code Line 4

Possible Bug with NoWiki tags
I created a few articles that ranged in length from 18 to 35,000 characters on a private wiki I set up on my own server using MediaWiki 1.11. I realized afterward that I needed to add some  tags to parts of the article to make it look right. The only problem is that after saving with these tags, when I go back and try to edit the articles again, I get this error: "Fatal error: Call to undefined function fnajaxsuggeststripcats in /home/deepspac/public_html/aaronmatthias/extensions/CategorySuggest/CategorySuggestFunctions.php on line 170" At the current moment I don't have FTP access nor access to my webserver control panel, so I haven't tried disabling the extension yet. Any thoughts or suggestions??? --Ds093 15:06, 15 November 2007 (UTC)


 * I have the same error message as soon as  tags are in an article. I use Mediawiki 1.11.0 and CategorySuggest 1.0 --Alex 10:42, 27 November 2007 (UTC)
 * solved: I checked the code and it looks like a typo in CategorySuggestFunctions.php. Please replace line 170 with the string below --Alex 11:04, 27 November 2007
 * $cleanedtext = fnCategorySuggestStripCats($regulartext,$arrAllCats);

Updated the code, thanks, Lindele 18:03, 10 March 2008 (UTC)

Suggest portion not showing?
I also am not seeing the Category Suggest portion showing up.
 * Same here. I have MediaWiki: 1.11.0 PHP: 5.2.5-tuxtools (cgi) and MySQL: 4.1.22 -- 141.30.75.108 13:11, 27 November 2007 (UTC)
 * You should both check if category suggest is correctly installed on Special:Version. Beside that, the portion only shows up in edit mode. --Alex 18:36, 30 November 2007 (UTC)

Previewing the changes
Would it be possible to make a patch where the categories that are currently written in the box don't get dumped when the article changes are previewed? I wind up having to copy and paste the category list every time on my Wiki each time I preview the page. 68.219.84.74 03:12, 21 December 2007 (UTC)

Completed, Lindele 18:03, 10 March 2008 (UTC)

Removing categories!
I installed this on Mediawiki 1.11 and while it adds a category to an article, if you preview it the categories go blank and when it is finally saves all the categories (new and old) are deleted. I think this may be a product of having to enter a captcha before saving.

Preformatted text problem.

I found a problem with preformatted text. When I click edit on a page with preformatted text, the leading spaces got trimmed. Looks like the $m_pageObj->textbox1 = trim( $finaltext ); line in CategorySuggestFunctions.php is causing problem.

We've encountered the same problem (categories were deleted from page at preview). A solution to this problem is very much appreciated.

I don't understand the problem. Can you please explain further? Lindele 18:03, 10 March 2008 (UTC)

List of issues
Andreas, there's a lot of interest in CategorySuggest where I work as a way of getting categories on pages. Unfortunately, in addition to the issues noted above (error in code,  causes bad page processing, categories dropped on preview, leading spaces are removed), there's a few other things that came up: Are you still working on this extension? It seems that not parsing the page and adding the categories client-side (like the toolbar) could get rid of a number of problems. --JaredM 20:50, 15 February 2008 (UTC)
 * adds a space after a < /nowiki> tag for each time the page is edited,
 * adds a line break before each  tag for each time the page is edited,
 * Tried to solve this, but haven't found a solution yet. Any suggestions are welcome.Lindele 18:03, 10 March 2008 (UTC)
 * it tricky to use with and tags, (perhaps there should be a user preference to turn it off, so they can prevent pages being parsed)
 * Can you explain further, please? Lindele 18:03, 10 March 2008 (UTC)
 * categories with characters other than spaces, letters and numbers are not found on the page (e.g. ".", "-"),
 * category lookup is case-sensitive,
 * hard to use with | to reorder categories
 * Any suggestions are welcome, Lindele 18:03, 10 March 2008 (UTC)
 * even if it doesn't use the API for queries, it should use the mediawiki database access functions rather than embedding the database user and password in the script,
 * the path to the javascript file could be a variable that could be set in localsettings.php,
 * sometimes does not show categories that have just been added (caching issue),
 * does not look up categories including some special characters when you type them (e.g. &),
 * inserts some special characters in markup format (e.g. & becomes &amp ;),
 * form should be created by javascript extension so it is not presented to users without javascript,
 * Soeren notes that the suggestions are currently sent with no charset specified,
 * should it make use of the Ajax library?
 * this extension seems to disable the special:allmessages function: the page comes up blank

I have moved most items to the To Do list, please check it out. Thanks for collecting this extensive list. Lindele 18:03, 10 March 2008 (UTC)

Passing SERVER, USERNAME, PASSWORD, DBNAME and DBPREFIX
Posted by --AuroraCA 18:46, 9 March 2008 (UTC)AuroraCA

I don't understand why the CategorySuggestSuggest.php needs to be edited to enter the server, USERNAME, PASSWORD, DBNAME and $wgDBprefix when these are specified by the variables $wgDBserver, $wgDBname, $wgDBuser, $wgDBpassword and $wgDBprefix in LocalSettings.php. Are these not passed or can they not be passed to CategorySuggestSuggest.php?

The code for CategorySuggestSuggest.php could be changed from:

to:


 * The current implementation does not make use of the internal Ajax library. So the file CategorySuggestSuggest.php is called directly from the browser as part of the Ajax call.  LocalSettings.php is not called by the procedure, so it has no idea of the MediaWiki globals.  --JaredM 12:44, 10 March 2008 (UTC)

Completed (replaced with internal AJAX function, hence, this configuration and the file itself are obsolete), Lindele 18:03, 10 March 2008 (UTC)

Style not being applied
I was having a problem where the stylesheet css was not being loaded and therefore the box not being styled correctly. To fix this issue, I changed $wgHooks['OutputPageParserOutput'] in CategorySuggest.php to $wgHooks['BeforePageDisplay'] and removed the second parameter from fnCategorySuggestOutputHook in CategorySuggest.body.php.


 * Excellent, thanks! This solved numerous problems for me (using MediaWiki 1.13.1).

How to specify multiple categories?
How do I select multiple categories? Is there any seperator character?

Alain le Sage (212.178.122.3 13:56, 18 June 2008 (UTC))

I have the exact same question, hopefully someone still notices this. --DaPete 15:43, 3 April 2009 (UTC)

=> ";" does the trick, no space, just category1;category2;...

Internationalisation problems
Very nice extension and quite good until now, even if the bug with  are still a bit problematic for me...

On Frenche, Category is replaced by Catégorie and this is a source of problems for me. I looked at the code, tried to replace the line 198 of CategorySuggest.body.php, but it didn't worked...

$m_pattern = "\[\[({$m_catString}|category):(.*)\]\]";

One other problem is that I'm not allowed to enter UTF characters like "é" in my i18n.fr.php file...

You may use html entities instead ;)

Translation of CategorySuggest.i18n.php into french : $messages['categorysuggest-title']	= 'CHOIX DES CATEGORIES (tags)'; $messages['categorysuggest-subtitle']	= 'Veuillez saisir le nom d\'une cat&eacute;gorie (tag) pour cet article.'; $messages['categorysuggest-boxlabel']	= 'Cat&eacute;gories'; $messages['categorysuggest-taglabel']	= 'Cat&eacute;gories populaires';

Problematic with Templates
it tricky to use with &lt;includeonly&gt; and &lt;noinclude&gt; tags, (perhaps there should be a user preference to turn it off, so they can prevent pages being parsed)
 * Can you explain further, please?

One example that might help; I'm writing a template that has different categories depending upon if it is included in a page or viewed as a template so I want categories inside &lt;includeonly&gt; and &lt;noinclude&gt; tags but this extension keeps stripping them out. The only solution I have found so far is disabling the extension while I create this template. It would be better to have it disabled on Template pages or, as the original poster suggested, allow the user to turn off the extension when they want.
 * Has there been and development on this issue? I am interested in any sort of solution.--Siadsuit 13:12, 27 September 2010 (UTC)

CategorySuggest for Postgres
This category don't run on mediawiki 1.12 (and 1.13, 1.13.1) + postgres 8.1. I have saw that it call mysql function in the code.

The function was  (used in CategorySuggest.php:65) only available in MySQL, the equivalent in PostgreSQL is.

Another issue with PostgreSQL:

In CategorySuggest.php:52 the code is

Exists any equivalent in PostgreSQL?

TESt—“‘«‹›»’”

Problem if category has apostrophe
Big problems with support for categories that have apostrophes.

Fixed by wrapping category output in htmlentities (CategorySuggest.body.php:62)

Per Section Editing
Bug: suggests categories on pages which already have categories when author is making per section changes. Using MW 1.13.2 and CategorySuggest 1.1 (2008-03-10) --Robinson Weijman 14:18, 27 July 2009 (UTC)


 * I'm amazed there have been no responses to this. Has anyone else seen it?  This is a critical error to me.  --Robinson Weijman 15:34, 15 February 2010 (UTC)


 * maybe this is not really a problem, because categories only work for a whole page, not for a section? So if you enter an additional category this should not be a problem, right? Raimund 16:16, 17 February 2010 (UTC)


 * Thanks for the reply. The problem is that:


 * 1) categories that are on the page are not shown in the dialog.  Which further means:
 * 2) if the user again enters the same category (in per section editing) then the page will show the same category twice (when page editing - not when viewing).

The solution (I think) is simple: when per section editing, show which categories are present. --Robinson Weijman 12:49, 18 February 2010 (UTC)

Category markup in the list when 3 or more categories
Bug: with the current implementation, the category list gets messed up with Wiki markup if there are more than 2 categories. For instance:

[[Category:C]]

is displayed as:

A]] [[Category:B;C

Solution: change the regexp line 201 in CategorySuggest.body.php as follows $m_pattern = "\[\[({$m_catString}|category):(.*?)\]\]"; (new is the question mark after the asterisk. this makes it non-greedy) --User:moloch timur lenk

How can I change the Category suggestion Text?
"CATEGORY ASSIGNMENT Please enter the name of a category for this article." How can I change the Text above the Category-Box? Raimund 16:21, 17 February 2010 (UTC)

I would like to edit this too, to include instructions on how to add multiple categories Helen 28 April 2010
 * I added the following line to the CategorySuggest.i18n.php file:

and then on CategorySuggest.body.php, line 61 add --Fladei 19:27, 26 May 2011 (UTC)

Add max results and fix capitalization problem
Nice plugin but too many bugs unfortunately. This code will fix capitalization problem as current code attempt at being case insensitive is broken and only picks up categories that are full caps The second part of the fix is limiting the number of results returned. Macsux 21:46, 4 March 2010 (UTC) -- Thank you very much for you code Macsux! It works! The above function is in the CategorySuggest.php file. 2013-01-27

NoWiki new line bug
This code will solve the issue of new line being added before nowiki each time page is saved. There was also other formatting issues associated with it that I think I hammered out. There should be no wikitext changes around nowiki blocks now

Change line 177 to be

Change line 182 to be

Change line 209 to be

Add at line 226

Other comments
it's nice ,we hope the new version can like this Extension:ManageCategories,i think this extension is better.

hmmm it works for category inserting and retrieving. however, I dont see a the category preview with this extension I tried it on MW1.11 and MW1.93 both Firefox and IE6 fail to do this.

the extension on itself is quite nice I have to say User:Dynasource

The preview of Mediawiki doesn't show category links. There is nothing I can do. Lindele 18:03, 10 March 2008 (UTC)

Clone categories
Clone categories then using ConfrirmEdit + QuestyCaptcha for Edit pages

Change Color of Font
Is it possible to assign a variable where we can change the font color of the options available in the drop-down?

If not, in which file would I make the change, and where?

I'd like to change it from red to standard black.

Thank you in advance.

--Technomensch (talk) 15:05, 25 July 2013 (UTC)

Inquiry regarding performance in 1.21
Installed extension for first time ever in MW 1.21.

When I go to EDIT a page, and scroll down to the "Category Assignment" box, if a page already has been assigned to a Category, then the Categories appear in MW link text instead of basic text.

For example:


 * CATEGORIES:  Category3 etc...

The way I expected it to work, and I could be mistaken, would be:


 * CATEGORIES: Category1 Category2 Category3 etc....

Since I haven't tried it on an older version, is this expected behavior?

--Technomensch (talk) 15:11, 25 July 2013 (UTC)

Doesn't work with MW 1.22 ?
Hi. I would like to know if someone has been able to use CategorySuggest with MW 1.22. Categories typed in the field are added, but when editing, the existing categories aren't displayed in the field. --Varlin (talk) 23:01, 3 January 2014 (UTC)

Category List doesn't re-sort when a Category name is entered
MW 1.22.6 CategorySuggest v.1.1

It seems to work but when you type in a Category Name into the Categories box, the long list of categories doesn't jump to the letter the Category Name begins with. Very frustrating when your list of categories is long. --Wmat (talk) 18:26, 1 May 2014 (UTC)

Upgraded to MW1.23 today and still experiencing this sorting issue.--Wmat (talk) 14:54, 5 June 2014 (UTC)

Switch for upload German mediawiki Version 1.22.6
Hello from Berlin,

Is there a parameter to switch this extension on just for uploads?

Thank xou for your attention--&#91;&#91;User:Bmrberlin&#124; Bernd M.&#93;&#93; (talk) 12:19, 10 October 2014 (UTC)


 * There is not such a parameter currently, though I'm happy to review and integrate Pull Requests submitted via Github. Adamfranco (talk) 15:38, 10 October 2014 (UTC)


 * I'm not at all familiar with this Github tool. So I do not know, how to address a request.--&#91;&#91;User:Bmrberlin&#124; Bernd M.&#93;&#93; (talk) 16:08, 10 October 2014 (UTC)

Useless files
CategorySuggestFunctions.php and CategorySuggestSuggest.php are useless files, as they define (with huge errors) the same functions defined in the main and in the body files. Please remove them from the package, they only improve the mess.

A lot of attention is paid to the whole XHTML matter, up to and including the CDATA section in the inline script... Then you end up with a bunch of useless document.write (.body.php, lines 58 and below). Document.write is not an allowed method in XHTML and for a lot of good reasons. I'm going to change it to innerHTML in my version, please do the same in the master.

Include a "margin-bottom:0" CSS statement in the stylesheet. Some skins add strange margins and the suggestion list appears detached from the input.

Add a new line of text in i18n for the suggestion title tooltip, and load it with an inline tag so that the text does not appear in English (e.g.

$m_pageObj->$m_place .= "/*<![CDATA[*/ var categorysuggestSelect = \"". wfMessage( 'categorysuggest-select' )->text ."\"; /*]]>*/ \n"; (.body.php, line 55)

result.title = categorysuggestSelect; (js, line 75).

The extension experiences a bug: when the $wgDefaultUserOptions['forceeditsummary'] is enabled in localsettings, and the page is reloaded because no summary has been provided, the inserted categories wikitext ([[Category:]]) is displayed on top of the reloaded textarea, and categories are not stripped from text. I'm going to try and patch this. Feel free to give suggestions about how to do it, but I need it quite soon so I'll try it myself.

Categories are stripped from and sections, and then reinserted out of them. I'm going to insert a drag-and-drop JS mechanism to reinsert categories in specific places if needed.

I will submit all the changes as soon as they're done. Thanks for all your effort.

--AndySky21 (talk) 16:16, 17 February 2015 (UTC)