Extension talk:SelectCategory

Selectbox-Style
Is it possible to make the category listing with Select category look like Categorytree, so if you have 500 categories, you don't have to browse trough all but push the + symbol in front of the main category. --Aroekene 22:00, 5 June 2008 (UTC)
 * I have the same request! THis would be great!

After changing the css-definition of ul#SelectCategoryList (and not just the css-id #SelectCategoryList) to the following: ul#SelectCategoryList { list-style-image: none; list-style-type: none; background-color:#EEEEEE; height: 150px; width: 50%; overflow: scroll } the SelectCategoryList is a bit less space-hogging (and I think "my" category-list isn't that long...), but I really think another way of displaying the choosable categories is very much needed! A solution alike to the CategoryTree would be great, but I also think having more than just one column in the SelectCategoryList might be another way to increase the usability. Sadly, my programming-/css-knowledge is way to small to conquer the task. :-( Hopefully, somebody reading this has the know-how.

--Katwol 13:44, 13 November 2009 (UTC)

Call-time pass-by-reference
Warning: Call-time pass-by-reference has been deprecated in ...\mediawiki\extensions\SelectCategory\SelectCategoryFunctions.php on line 21

Warning: Call-time pass-by-reference has been deprecated in ...\mediawiki\extensions\SelectCategory\SelectCategoryFunctions.php on line 103

I tried and
 * allow_call_time_pass_reference = On in php.ini
 * adding "?>" at the end of the php files

but this did not fix anything

Please suggest a fix, thank you.

Different version - same error
After upgrading to MediaWiki 1.15.1 and the concurrent extension-snapshot I get the same error-messages:

Deprecated: Call-time pass-by-reference has been deprecated in /opt/lampp/htdocs/_fhbwiki/extensions/SelectCategory/SelectCategoryFunctions.php on line 21 Deprecated: Call-time pass-by-reference has been deprecated in /opt/lampp/htdocs/_fhbwiki/extensions/SelectCategory/SelectCategoryFunctions.php on line 103

I've tried putting:

error_reporting(0);

at the beginning of SelectCategoryFunctions.php but that makes no difference whatsoeverer.

As far as I can say, the extension works, but instead of displaying the usual selection-window a long list with control-boxes appears.

Everything works ok with: MediaWiki 	1.14.0 PHP 	5.2.9 (apache2handler) MySQL 	5.1.33

But the error occurs with: MediaWiki 	1.15.1 PHP 	5.3.0 (apache2handler) MySQL 	5.1.37

I also need help with fixing this.

--Katwol 11:56, 17 August 2009 (UTC)

- Pleae Try this --> Workaround search all "&$" and replace it with "$".

Download of tar does not work
Extraction error.

Please fix this thanks.



comment: worked fine for me on 2010-01-18

$wgSelectCategoryEnableSubpages ignored
I testet the extension under 1.10. But the disabling selection by subpages will be ignored if $wgSelectCategoryEnableSubpages = false; -- User:OZZ 18.052007

Seems to be just a typo in the code, just replace in the functions php $wgSelectCategoryEnableSubpage with the correct  $wgSelectCategoryEnableSubpages -- Venia 15:52, 10 December 2008 (UTC)

Has someone tried it on 1.6.8?
Is there a technical reason that it does not work there?


 * Yes, there is. We introduced new member variables which will be available in release 1.8.3. Otherwise it can't work. --80686 14:04, 29 November 2006 (UTC)

not removing categories
I think it's better if categories aren't removed from the edit box. I've sumitted a batch at 8359. It might also be nice if the categories had checkboxes next to them, but that seems a little more complicated; this simple solution makes the extension seem more useful for me. -Steve Sanbeg 20:06, 22 December 2006 (UTC)


 * working on it. It's not that easy, but it will work. On the other hand will this handling lack of the comfort the extension should provide. --Manuel Schneider(bla) (+/-) 21:57, 3 January 2007 (UTC)


 * Cool. For the uses I see for it now, it isn't necessary to completely hide the categories; and this option would prevent someone from clicking a category on the list and accidently removing all of the existing categories. -Steve Sanbeg 17:08, 5 January 2007 (UTC)


 * I upgraded my wiki, and was starting to test in production when I discovered the cycle bug. so I guess that will have to wait. But I wanted to mention (in case you didn't notice) that my patch also fixes one other, minor bug; there was a missing preg_quote on the custom namespace, which could break if someone names their namespaces oddly. -Steve Sanbeg 19:24, 19 January 2007 (UTC)


 * I just added a javascript file to my install of this extension that simulates the behavior of holding Ctrl when selecting categories in the multi-select box. This way selecting a new category does not unselect any existing selected categories.  -Jimmysessions


 * I added checkboxes and submitted a patch. Leon Weber was kind enough to add my patch to the next revision. --Emceelam 19:12, 25 July 2008 (UTC)

Fatal Error
I'm getting a fatal error when trying to create or edit a page using this extension. I'm Using Mediawiki 1.8.2.

Fatal error: Call to undefined method Title::isSubpage in /mounted-storage/home24b/sub001/sc112516-ZBLG/wiki/extensions/SelectCategory/SelectCategoryFunctions.php on line 25


 * SelectCategory doesn't work with MediaWiki 1.8.2. Go read the contents in the red box on SelectCategory. --Manuel Schneider(bla) (+/-) 19:25, 3 January 2007 (UTC)

Considerations
I was about to post about that which was mentioned above - this definately shouldn't remove the categories from the edit box itself. The reason *I* was going to bring forward was different - lots of templates place pages they are transcluded onto into categories, and most such templates have their categories in tags. There are also other such cases where the placement within a page of the category tag matters - so I would appreciate it if the previous poster's suggestion and/or patch are applied, for very good reasons. Secondly, again, sometimes categories are assigned to a page by way of templates transcluded onto it, or other things - so it may be a good idea to list below the box the categories that the page is in that aren't in the box. Maybe also remove them from the box, as they shouldn't be unselected (or selected, for that matter) there.

One other thing I was considering, is that it might be a good idea to make this a seperate page - as in, perhaps a 'categorization' caction tab, or a 'categorize' button under the edit form along with save, preview, and changes - that way, a user could go to a SEPERATE page to work on the categories using this cool method, then return and see the changes - we don't really want two ways to do the same thing on one page, and having the AJAXified box AND the normal text box is exactly that - two ways to do the same thing. Did that make sense? I mean like the user clicks a 'categorize' button under the edit summary box, they get taken to perhaps a special page, or just another page action, where there is nothing but the selectcategories box, and a list of categories the page is in - then they can change them, and click 'save categories' to return. Peerless 03:11, 6 January 2007 (UTC)


 * I agree with that. Although I don't think this extension could ever work well in template space, my patch would prevent it from being a complete disaster.  A categorization tab could be cool. -Steve Sanbeg 19:18, 19 January 2007 (UTC)

Enhancement
would a category cloud (like a delicious tag cloud) be possible. It strikes me that categories are equivalent to tag) and having the most popular ones most highlighted may be helpful.. (not so for esoteric subjects) but on the whole helpful. Perhaps mediawiki would be enhanced by tags as well as categories (sort of meta categories)


 * There are at least two extensions that already offer tag or category clouds, ie Extension:YetAnotherTagCloud and Extension:CategoryCloud. I don't think either of them offer them on the edit page though. pfctdayelise 04:19, 19 April 2007 (UTC)

It would also be helpful to remove "parent" categories, or the current category from the select list. This would prevent users from creating circular references.

Bug When Category Name Has Space In It
I've noticed a bug in the current version from SVN (haven't checked the latest stable). If an article is part of a Category which has a space in it's name (example: Category:Test Servers), it doesn't show as selected in the list when editing the page (although the Category does show up in the list). Haven't tested what happens when I hit save but I assume it would be removed from the Category. --128.233.131.139 21:46, 23 March 2007 (UTC)

I hit save - it removes any categories not selected, which makes this extension too dangerous to use on an existing wiki page for users who aren't aware of the bug. It seems that an underscore is an acceptable character instead of a space. --24.97.28.170 03:54, 22 June 2007 (UTC)


 * See Extension_talk:SelectCategory below.
 * This problem is fixed in SVN trunk. --Leon 17:32, 5 August 2008 (UTC)

New install - No category list
MW 1.9.3, apache, WinXP fairly new install

I have just downloaded the tarball and installed the extension. I have added the require_once. I have tried leaving the defaults and do not get anything when going into edit.

We have refreshed the browser and have tried a different browser and workstation. Still nothing.

Not sure what we might have missed. Ideas?--Dtsig 21:50, 30 April 2007 (UTC)


 * You have already created some categories... right? :) --pfctdayelise 11:29, 1 May 2007 (UTC)
 * Sorry should have said that. Yes.  We also use CategoryTree and it is working.  Is there anything else to do with the install other than putting the folder in extensions, add the require_once line to LocalSettings?  Just to be sure that it was firing I did put an echo at the beginning of SelectCategory.php and it did display (wasn't actually firing for the event but just the require fired it).  Any debug ideas?  problem with php .. it is like old languages where you had to debug to a line printer --Dtsig 12:23, 1 May 2007 (UTC)
 * Still trying to work this out. What would be the best way to debug this.  To get output of anything so we can be sure that the hook is firing?  Thanks --Dtsig 13:51, 11 May 2007 (UTC)


 * Further, I placed the following code at the start of each function (with correct function name) so i could see what the last function that was it was thinking this might help you know where it seems to be stopping. The file showed 'fnSelectCategoryOutputHook'.  Not sure if this helps but this appears to be the last thing that happens.

$rtn = file_put_contents ( 'phptest.log', 'got here - fnSelectCategoryOutputHook');
 * Ideas?? --Dtsig 15:11, 11 May 2007 (UTC)


 * And the answer is .. Conflict. We are also using DiscussionThread extension.  I am sending a note to its developer and hope that you and/or he can figure out where the conflict comes from.  Please let me know as both are great extensions for out users.  --Dtsig 15:34, 11 May 2007 (UTC)

Conflict Resolution?? --Dtsig 18:08, 11 May 2007 (UTC)
In working with the author of ThreadDiscussion we found that he had left 2 wfDebug functions in his code. Although this SHOULD NOT effect SelectCategory it appears that it does. This might be something you want to look into .. thanks

Sort
The category select box does not seem to sort ? is this a bug or will this be done in the future?

Mediawiki 1.9.2

Many thanks --Markw21 11:56, 8 May 2007 (UTC)

Preview removes all categories --Dtsig 18:09, 11 May 2007 (UTC)
It appears that using PREVIEW will remove the categories. My guess is that since you strip out the categories upon entering the editor, they are forgotten and lost during preview. This seems to be a problem.

Being Reviewed? --Dtsig 18:53, 17 May 2007 (UTC)
Has this been looked into? Can anyone else verify this?? thanks

Noted in Bugs on first page --Dtsig 19:19, 17 May 2007 (UTC)
Check out .. See bugzilla:9849 for a patch.

MW 1.10 and preview error --Dtsig 16:18, 20 June 2007 (UTC)
If you enter the following wrapped in pre tags (or code or geshi highlighting)

this starts on col 1 this starts on col 3 this starts on col 5

Then in edit/preview mode the spaces are all removed. If we comment out

then all works well


 * See Fix for trimming white space. --Bluefoxicy 18:22, 19 September 2007 (UTC)

Attachment 3600 Details for Bug 9848
after searching bugzilla I found this .. then noticed that there is a bug list on the extension page. Thought that this was usually on the discussion page. --Dtsig 16:23, 20 June 2007 (UTC)

Fix for multiple categories on one line --PaulHat 17:26, 13 July 2007 (UTC)
This is assuming you've done all the fixes from bugzilla. 241d240 < 243,247c242 <      #$m_pattern = "\[\[({$m_catString}|category):(.*)\]\]"; <      #PMH: BEGIN My fix for multiple categories on one line problem <              $m_pattern = "\[\[({$m_catString}|category):(.*?)\]\]"; <      #PMH: END My fix for multiple categories on one line problem < --- >      $m_pattern = "\[\[({$m_catString}|category):(.*)\]\]"; 249d243 < 265,275c259 < <              #$m_catLinks[ preg_replace( "/.*{$m_pattern}/i", $m_replace, $m_textLine ) ] = true; <              #PMH: BEGIN My fix for multiple categories on one line problem <                      $cats = preg_replace("/.*?{$m_pattern}/i", "$2,", $m_textLine ); <                      $cats = preg_split('/,/', $cats, -1, PREG_SPLIT_NO_EMPTY); < <                      foreach( $cats as $cat ) { <                              $cat = preg_replace("/ /", '_', $cat);  #Fixes categories with spaces <                              $m_catLinks[ $cat ] = true; <                      } <               #PMH: END My fix for multiple categories on one one line problem --- >              $m_catLinks[ preg_replace( "/.*{$m_pattern}/i", $m_replace, $m_textLine ) ] = true; I don't really like the comma I added to separate the categories in the preg_replace, but it works.

MW 1.10.1 / WinXP/IIS - Category not pre-selecting
Hi, i just dl'ed and installed this and followed the directions (which were very clear by the way-thanks) to install the extension. I have added the require_once.

Everything works except that if a page already has caterories in it then they are not pre-selected in the multi-select list.

Is this on purpose? Cheers, Wayne

Bug on no categories selected
The below patch fixes a bug for when a user selects 0 categories. Patches SelectCategoryFunctions.php

--- SelectCategoryFunctions.php	2006-12-17 12:27:48.000000000 -0500 +++ SelectCategoryFunctions.php.new	2007-09-18 16:20:29.000000000 -0400 @@ -88,6 +88,12 @@ function fnSelectCategorySaveHook( $m_is 	$m_catString = $wgContLang->getNsText( NS_CATEGORY );  	# Get some distance from the rest of the content:  	$m_text = "\n"; + +	# Check if the category list was left blank. +	if (empty($_POST['SelectCategoryList'])) { +		return true; +	} +  	# Iterate through all selected category entries:  	foreach( $_POST['SelectCategoryList'] as $m_cat ) {  		$m_text .= "\n$m_catString:$m_cat"; @@ -243,4 +249,4 @@ function fnSelectCategoryGetPageCategori  	# Return the list of categories as an array:  	return $m_catLinks;  } -?> \ No newline at end of file +?>

I submitted a patch to Leon Weber that fixes this bug. Not quite the same solution, but it fixes the bug nevertheless. My patch has been included in the current release. --Emceelam 05:42, 1 August 2008 (UTC)

Existing categories bug
The function fnSelectCategoryGetPageCategories needs to do a number of things to work correctly and efficiently:


 * Make a copy of the page text in another variable
 * Remove all lines not matching the category pattern
 * Split each line at and
 * Remove all lines not matching the category pattern
 * Convert spaces to '_'
 * For this last item, see Extension_talk:SelectCategory.

This will solve the following two problems:


 * Multiple categories on one line show up as only the last category link
 * Categories with spaces don't get selected

Note that the categories lists generated by the extension itself always work.

Critical Crash on Edit
Hi there, this has been a real pain to track down, but finally found that the SelectCategoryList was causing the problem.

Symptoms - cannot edit any wiki page.

Having reverted Apache versions and many other things, get php error output, can now see following errors...

[19-Sep-2007 14:12:21] PHP Notice: Undefined index:  SelectCategoryList in C:\htdocs\wkbv_wiki\extensions\SelectCategory\SelectCategoryFunctions.php on line 92

[19-Sep-2007 14:12:21] PHP Warning: Invalid argument supplied for foreach in C:\htdocs\wkbv_wiki\extensions\SelectCategory\SelectCategoryFunctions.php on line 92

If I remove SelectCategory extension from the LocalSettings.php all works fine....

Any ideas, or should I go back to manually editing categories. --Markw21 16:43, 19 September 2007 (UTC)


 * See the above patch about blank categories lists. --Bluefoxicy 18:20, 19 September 2007 (UTC)

Fix for trimming white space
If you trim the white space from the beginning and end of a line, you wind up killing indents (see the below diff? Edit the page and save with your extension and it becomes a big blob of text). You simply inappropriately used trim.

--- SelectCategoryFunctions.php.old	2007-09-19 14:17:49.000000000 -0400 +++ SelectCategoryFunctions.php	2007-09-19 14:19:07.000000000 -0400 @@ -237,7 +237,7 @@ function fnSelectCategoryGetPageCategori # Check linewise for category links: foreach( explode( "\n", $m_pageText ) as $m_textLine ) { # Filter line through pattern and store the result: -               $m_cleanText .= trim( preg_replace( "/{$m_pattern}/i", "", $m_textLine ) ). "\n"; +               $m_cleanText .= preg_replace( "/{$m_pattern}/i", "", $m_textLine ). "\n"; # Check if we have found a category, else proceed with next line: if( !preg_match( "/{$m_pattern}/i", $m_textLine) ) continue; # Get the category link from the original text and store it in our list:

Blank category page
tested with MW 1.11 getting the form on edit pages. but when click on a category link, getting a blank page. how to correct this?

--Jack

Added an add category inputbox and fixed uppercase bug and spanish i18n
There is a certain bug when a certain category has lowercase initial letter, the extension "forgets" to include it. Also added a box to make a new category

the diff script for SelectCategoryFunctions.php

51a52,53 >              $m_textBeforenew = '. wfMsg( 'selectcategory-new' ). :'; > $m_pageObj->$m_place .= "$m_textBeforenew &lt;br/>"; 90a93,98 >      if ( isset($_POST['NewCateg'])){ >      // add category >              $m_cat = $_POST['NewCateg']; >              $m_cat = ucfirst($m_cat); >              $m_text .= "\n$m_catString:$m_cat"; >      } 238c246,248 <              $m_catLinks[ preg_replace( "/.*{$m_pattern}/i", $m_replace, $m_textLine ) ] = true; --- >              $m_textLine2 =preg_replace( "/.*{$m_pattern}/i", $m_replace, $m_textLine ); >              $m_textLine2 = ucfirst($m_textLine2); >              $m_catLinks[ $m_textLine2 ] = true;

New file SelectCategory.i18n.es.php

$messages['selectcategory-title']	= 'Seleccione las categor&iacute;as'; $messages['selectcategory-subtitle']	= 'Para seleccionar m&uacute;ltiples categor&iacute;as contiguas use Shift-click, para categor&iacute;as no contiguas use Ctrl-click.'; $messages['selectcategory-new']	= 'Agregar categor&iacute;a';

Addition to SelectCategory.i18n.php

$messages['selectcategory-new']	= 'New category';

-- Miguel 189.181.98.205 20:12, 12 October 2007 (UTC)

Running problem
Hi all, i try tu use this extension but I have a sql error in the wiki page. show the message: Erreur base de données

//database error

Erreur de syntaxe dans la base de données. La dernière requête traitée par la base de données était :

(requête SQL cachée) //hidden sql request

depuis la fonction « fnSelectCategoryGetChildren ». MySQL a renvoyé l’erreur « 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'espace_"Portail"' AND tmpSelectCatPage.page_namespace = 14' at line 4 (localhost) ». thanks for your help.

Shilom 19:54, 14 October 2007 (UTC)

SelectCategoryTagCloud is stripping Leading spaces from text lines
Hey all, first off I just wanted to say I love this extension. I tend to forget the spelling of my categories and always get them messed up this is a huge help. That being said I discovered a problem with the extension. It strips out the leading text from your wiki page. This is only a problem if you are trying to use the leading spaces to create sections on the page. I tracked the problem back to "CategorySuggestFunctions.php" file. In here you are using the "trim" function which strips the blanks from BOTH the front and end of the lines. I changed all 4 "trim" commands to "rtrim" and the extension is now working fantastically. Anyway I wanted to pass this info on so it can be included into the new versions.

- John P 18 Nov 2007

Problem
Hey i had istalled this extension but it doesnt work there come some warings above my page:

1.     Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name]. If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /mnt/web5/20/83/51663183/htdocs/wiki/extensions/SelectCategory/SelectCategoryFunctions.php on line 21 2.  3.      Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name]. If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /mnt/web5/20/83/51663183/htdocs/wiki/extensions/SelectCategory/SelectCategoryFunctions.php on line 84 4.  5.      Warning: Cannot modify header information - headers already sent by (output started at /mnt/web5/20/83/51663183/htdocs/wiki/extensions/SelectCategory/SelectCategoryFunctions.php:21) in /mnt/web5/20/83/51663183/htdocs/wiki/includes/WebResponse.php on line 10 6.  7.      Warning: Cannot modify header information - headers already sent by (output started at /mnt/web5/20/83/51663183/htdocs/wiki/extensions/SelectCategory/SelectCategoryFunctions.php:21) in /mnt/web5/20/83/51663183/htdocs/wiki/includes/WebResponse.php on line 10

can anyone help me to solve this problem? thx :)


 * Add the following line to your php.ini:

allow_call_time_pass_reference = On
 * allow_call_time_pass_reference = On --> does not help
 * or try following solution --WIKImaniac 14:52, 14 January 2008 (UTC)


 * The headers errors can be solved by adding "?>" at the end of the php files of the extension. --Christian Ernst 00:15, 10 February 2008 (UTC)
 * --> does not help

is ignored
Hi there, if i use i a active Namespace, the extension also remove this categories, but do not place between after saving. Is there a other Solution, then the Patch above? --Ozz 19:46, 31 January 2008 (UTC)

No selection with FCKEDITOR Extension
I follow this FCKeditor_integration_guide. The FCKEDITOR shows the category in his text field but there was no selection in SelectCategory menu. I think it could be in the parser.php if i disable FCKEDITOR it works fine!

I use * MediaWiki: 1.10.2 * PHP: 5.2.4 (apache2handler) * MySQL: 5.0.45

Has anyone an idea to clean this problem ? Thank you very much for Help!

Try this: http://www.mwusers.com/forums/showthread.php?t=7257&highlight=category I haven't tested it but he claims it works. (Ed March 26, 2008)

Thomas: I will test it !! (March 27, 2008) I use * MediaWiki: 1.11.2 and 1.12.0 * PHP: 5.2.4 (apache2handler) * MySQL: 5.0.45


 * Hmm now i have this bug Bug when category has space in it
 * Only if i use select category and fckeditor 2.5.1
 * All other pages works fine!!

Thomas: Idea : It cuts the first part of the category name. For example the original:

PSP_Protokoll_2008

the result: _Protokoll_2008

Where is the first part "PSP" ??

Hy, I modified the Extension to work with FCKEditor, i made a update, now it should work with blanks in Categorynames:

I am sorry but it works only with the first space in the Name. The second space makes still the same problem. for example PSP_Protokoll_2008

the result: 2008

Patch to support categories with spaces
The following change seems to fix the problem where categories with spaces are silently ignored. Find the line preceded by "# Get the category link from the original text and store it in our list:" and change it to:

$m_catLinks[ preg_replace( '# #', '_', preg_replace( "/.*{$m_pattern}/i", $m_replace, $m_textLine ) ) ] = true;

Jlerner 16:02, 7 May 2008 (UTC)

Select category/Categorytree
Is it possible to make the category listing with Select category look like Categorytree, so if you have 500 categories, you don't have to browse trough all but push the + symbol in front of the main category. --Aroekene 22:00, 5 June 2008 (UTC)

That would require two things:


 * a code change: currently sub-categories are indented by &amp;nbsp;. They should be in a nested &lt;ul> instead.
 * some javascript to expand/collapse the tree when clicking the "+" symbol

--Cboltz 23:03, 16 June 2010 (UTC)

For the records: Version 0.8 contains exactly this feature :-) (jQuery treeview) --Cboltz 20:12, 28 February 2011 (UTC)

PHP has encountered a Stack overflow
This is the message I get when I try to edit pages now. SelectCategory worked fine for some hours of work, but now I get this message. Is there a way that I can debug the problem?

Info from Speciel:Version
 * Produkt 	Version
 * MediaWiki 	1.12.0
 * PHP 	5.2.5 (isapi)
 * MySQL 	5.0.51b-community-nt

Installed extensions

Parser hooks Andre Lockdown 	per-namespace group permissions      --Asset 17:25, 18 July 2008 (UTC)
 * Configure (Version 0.5.7) 	Allow authorised users to configure the wiki by a web-based interface  	Alexandre Emsenhuber
 * SelectCategory 	Allows the user to select from existing categories when editing a page 	Leon Weber & Manuel Schneider
 * LinkSuggest (Version 0.2) 	Ajax-based link suggest that places results below tool bar. 	Adam Meyer


 * What version of the SelectCategory extension are you using? Try to use the current code from SVN trunk. --Leon 17:24, 5 August 2008 (UTC)

Did you consider users mistake?
Hi, If a user create a category and then directly or indirectly make this category as its subcategory for example:

book --somebooks -- -- book

your extension goes to an infinte loop, and mediawiki breaks. please let me know if you solve this type of problems.

See User:Cm

How to have the category list to scroll ?
Hi, first of all excellent extension very pragmatic. I only have one problem, I'm not a software or developer or what not. My question is how to have the category list at the bottom to scroll?

What I did

 * 1. Get access/rights to MediaWiki:Common.css
 * you might need to get rights to edit common.css
 * you might need to create it
 * 2. Insert the following text:

ul#SelectCategoryList { height: 200px; width: 400px; overflow: auto; }
 * 3. Edit the width and height properties to be bigger or smaller according to preference.
 * you may need to delete your browser's cache in order to see changes you make to common.css

No SelectCategory-List when editing only parts of a page
For the casual user it is quite comfortable to choose from the list. But I also have the extension "RequireCategory" which forces the user to assign at least one category when trying to save an uncategorized page. Otherwise the page cannot be saved. If one edits the whole site, SelectCategory is there to help my casual user. But if one edits only a part of an uncategorized page there is no SelectCategory-List and my casual user who does not know how to assign a category manually does not know what to do.

In short: can I show the SelectCategory-List also when editing only a part of a page?

Add Category box and disabling infinite category loops
If the user is editing a category page, the selectboxes for that category and all undercategories are greyed out. Code at User:Cm --Cm 15:40, 29 October 2009 (UTC)

Compatibility Problems with SemanticMediaWiki Queries
With the help of Semantic MediaWiki one can make Inline Queries, e.g. to create a list of all pages in a category which have the attribute xy > 2000 assigned. The Extension SelectCategory removes every  on every page, no matter if it is between "nowiki"- or "#ask"-tags. So if I want to make such a semantic #ask-Query which refers to a category, the query is broken by SelectCategory because it deletes the  and assigns the page to this category. Could this be changed please? --Laquestianne 09:20, 25 February 2010 (UTC)
 * I fixed it with a small change. See SelectCategory: Fixed by users --Laquestianne 12:11, 10 March 2010 (UTC)

Long Category List
Hello, we are thinking about integrating SelectCategory into our Wiki (www.pflegewiki.de). We experience the "problem" that many articles are being created/edited without applying a category to it. So I searched and found this one here. The PflegeWiki has got a lot of categories (something about 300) and this will be a very long list. Is there a way of compacting it in some way? Maybe a dropDownList or similar? Or shorten the list of cat's by not listing unused cats or just define cats to a certain namespace? I know a hell lot of questions but has anyone any suggestions to this? Thanks, --Bruder Lars 06:55, 7 April 2010 (UTC)

Cannot redeclare fnselectcategoryshowhook
Fatal error: Cannot redeclare fnselectcategoryshowhook in /home/sabda/public_html/labs/extensions/SelectCategory/SelectCategoryFunctions.php on line 18

These are the extension I installed: In that order
 * SyntaxHighlight_GeSHi
 * CharInsert
 * GoToCategory
 * DynamicCategoryMap
 * CustomCategory
 * CategoryWatch
 * CategoryTree
 * CategoryTests
 * CategoryTagCloud
 * SelectCategoryTagCloud
 * SelectCategory
 * CategorySuggest

Can someone help me resolve the error? Bennylin 02:39, 14 April 2010 (UTC)

How to avoid removing categories shown in edit box?
Hi, The extension seems to remove the category shown in edit box. How could i disable them to do it?

I tried this: Remove line 41 from SelectCategoryfunctions.php "$m_pageCats = fnSelectCategoryGetPageCategories( $m_pageObj );"

Then, categories now appears in edit box.

However, there is one drawback that the predefined list categories will not show which of them have been selected. Do anyone know how to solve it? Thanks a lot! --Dullmau 16:04, 8 June 2010 (UTC)

List predefined category and check those who are checked
set an array for predefined category: $cat_predefined= "Asia,America,Europe,Africa,Middle_East"; $catlist_predefined = explode(",", $cat_predefined);  If a category exists in a page, checkbox will be checked.  for ($i = 0; $i < count($catlist_predefined); $i++) { $checked = ''; if($category == $catlist_predefined[$i]))  $checked = 'checked';  }

 I've tested it, but it sometimes work only. The problem may lie in if($category == $catlist_predefined[$i])) .  $category may not be the variable for storing categories that exist in a page. --Dullmau 09:41, 10 June 2010 (UTC)

Hook fnSelectCategorySaveHook failed to return a value
Running v0.7dev on MediaWiki 1.16.1 I get the following message:

--62.153.230.99 13:02, 18 January 2011 (UTC)

You need to replace every occurrence of &$ with $ in extensions/SelectCategory/SelectCategoryFunctions.php in order to solve the error listed above. I'm not really sure, if this action may alter the behaviour of the code, since I do not have the necessary PHP-knowledge. Perhaps someone who's PHP-fluent can have a look, please?

--Katwol 11:05, 7 February 2011 (UTC)

I'm running MW 1.16.0, Vector skin, and when I use the stable release, I have the following problems: I reverted to an older revision still having the listbox, but that one works --83.65.127.178 10:51, 27 January 2011 (UTC)
 * above the categories the text  is shown instead of the real title
 * the [+] signs are not interactive. They are text-only and nothing happens when you click them
 * Ok, first was my fault, didn't rebuild the localisation cache. but I'm still struggling with the 2nd

--83.65.127.178 11:58, 27 January 2011 (UTC)

Get the current version from SVN, it works with 1.16 and has a much nicer userinterface (and fixes several issues) --Manuel Schneider(bla) (+/-) 10:58, 16 February 2011 (UTC)

MW 1.16.0 and vector skin, cat. tree is not working IE8
Great extension and almost perfect!

The [+] sign is not working and the subcategries are al listed. (collapsing and expanding is not working) clicking on the plus sign has some action by inserting a small blank line but thats all that happens.

Trying to find the problem I was performing some echo's in the php scripts and when I perform a php echo("x"); on line 80 in SelectCategoryFunctions.php (version 0.8, just before building the list) it seems to work. Sadly the editor box is affected also by the echo and is shrinked to approx. one third of the page so i cannot use it as work around.....

Any help about this is appreciated because this extension is a great help when editting pages on our Wiki!

Select Category on Upload
Am I right that this extension should also add categories to files while uploading? The category tree is available on Special:Upload but after uploading the files have no categories.

Thanks for Support --Filburt 11:04, 13 April 2011 (UTC)


 * That's probably https://bugzilla.wikimedia.org/show_bug.cgi?id=24911 (patch included, make sure to read all comments in the bugreport) --Cboltz 11:33, 13 April 2011 (UTC)


 * Wow, that's support! Thanks a lot for the very fast answer - now it's working perfectly... --Filburt 12:23, 13 April 2011 (UTC)

Tree expanded on load
I have edited the "Selectcategory.js" file such that the "collapsed" property is set to false, but the SelectCategoryList still loads collapsed.

$j( document ).ready( function {       $j( "#SelectCategoryList" ).treeview( { collapsed: false }); });

I am using version 0.7dev. My "LocalSettings.php" file includes: $wgSelectCategoryRoot = array(        NS_MAIN => "SDS" );

Anyone found a way to resolve this?


 * You should check the bugtracker if you hit a bug ;-) I'm especially talking about Bug 27795. The patch I attached there fixes the issue. AFAIK it was only applied in trunk - if you use branches/REL_X_YY, you'll have to apply it yourself.


 * Oh, and of course you'll have to set $SelectCategoryMaxLevel according to your requirements ;-) --Cboltz 17:24, 15 July 2011 (UTC)


 * @Cbolltz - I appreciate the response. Went ahead and made the necessary changes. Had one more question. Could you elaborate more on what value the wgSelectCategoryMaxLevel variable is expecting? Thx


 * Nevermind, figured it out. It's an integer. I set it to 2 and it works now. Thx.

IE9 issues
For some reason, in IE9, some categories are appearing as bullets, and not appearing as a collapsible tree. This only appears as an issue with IE9 so far. IE7-8, chrome, ff all appear fine. --Heylarson 20:34, 18 July 2011 (UTC)

bump --208.78.228.100 20:30, 1 August 2011 (UTC)

Created Bug 30557 to address this issue --208.78.228.100 20:06, 24 August 2011 (UTC)

$wgSelectCategoryRoot
I'm having a difficult time figuring out how exactly $wgSelectCategoryRoot is supposed to work. I thought if i selected a parent category it would show the children categories either as a list or perhaps (even better) in a tree form. I selected my top category which has a large quantity of children.. nothing happened. the only category that showed on the page was that one category. so i tried from the other direction. selected a child thinking that maybe the code would work its way backwards.. nope just the one category.

how is one supposed to implement the use of $wgSelectCategoryRoot ?

--Kay 12:01, 10 November 2011 (UTC)


 * Exactly as described on the Extension page. You have to specify the parent category and should get all child categories as a tree. Maybe the tree is collapsed by default and you have to click the "+" sign?


 * BTW: There are several open bugreports in the bugtracker, some of them include patches. Check if one of them affects you, and use the patch (if there is one). --Cboltz 18:06, 10 November 2011 (UTC)


 * i went thru the bugreports and can't really find anything that matches my issue. i tried removing the root. it appears i get categories with check boxes so i can select them but not pluses. the only categories that show up are the parent categories.. there isn't a plus or anything to expand them. i'm sure i've missed something but it isn't like there are many things i need to set up so i can't imagine where i goofed.

Incorrect closing li tag after ul
{{Patch --- SelectCategory_body.php    (revision 158) +++ SelectCategory_body.php    (working copy) @@ -70,6 +70,7 @@                       foreach( $allCats as $cat => $depth ) { $checked = ''; +               $liopen = false; # See if the category was already added, so check it                               if( isset( $pageCats[$cat] ) ) { @@ -94,7 +95,7 @@                                       $pageObj->$place .= '<ul style="'.$class.'">'."\n"; $level++; } -                              if( $level == $depth ) { +                              if( $level == $depth && $liopen ) { $pageObj->$place .= '</li>'."\n"; }                               while( $level > $depth ) { @@ -106,6 +107,7 @@                               $title = Title::newFromText( $category, NS_CATEGORY ); # Output the actual checkboxes, indented $pageObj->$place .= '<li'. $open. '><input type="checkbox" name="SelectCategoryList[]" value="'.$category.'" class="checkbox" '.$checked.' />'.$skin->link( $title, $catName )."\n"; +               $liopen = true; # set id for next level $level_id = 'sc_'.$cat; } # End walking through cats (foreach) }}
 * file = SelectCategory_body.php
 * function = showHook
 * description = Fix invalid markup closing li tag outputted if level == depth, added check that li has opened.
 * authors = Darren Clark <darren@cwebd.co.uk>
 * source =
 * date = 2012-01-26 22:39:00
 * mediawiki_version = 1.17.2
 * language = diff
 * code = ===================================================================

See also https://bugzilla.wikimedia.org/show_bug.cgi?id=30557 where I uploaded a patch (against an older version) to fix this and similar issues with wrong nesting of ul, li, /ul and /li. Can you please check if your patch fixes all nesting issues my patch fixes, and then post your patch in bugzilla? --Cboltz 21:10, 27 January 2012 (UTC)

Missing Categories
After updating my mediawiki the displayed categories have not been equal to the list in Special:Categories. I've been checking the SelectCategoryFunctions.php and found the global variable $wgSelectCategoryMaxLevel. This variable is used for settings the depth the loop is going through. In LocalSettings I have set this variable to 5 and now all categories are displayed again. Does anybody see any problems using this variable, because it is not documented?

-- Chris 17:01, 06 February 2012 (UTC)

Unable to download the extension
At the moment it's not possible to download the extension. Not using the "Download snapshot" neither the link to the git repro work ! Wingsofcourage (talk) 14:51, 28 June 2012 (UTC)
 * Download works only via SVN: http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SelectCategory/

Placing Listbox on the right side
Is it possible to place the LIstbox for selecting the Caregories also on the right side and not under the editbox?

-- Micha 15:59, 21 August 2012

Ignore specific category
Hello, I recently started using this extension, and it works like a charm!

I do have a question though, is it possible to ignore a specific category so that it can't be selected?

Thanks in advance!

Bjorn (11 september 2012)

Maintained?
Hi, just wanted to check - is Leon or Manuel maintaining this extension? There are several open bugs that need addressing. Thanks. Sumana Harihareswara, Engineering Community Manager (talk) 13:10, 21 September 2012 (UTC)