Opened 17 years ago
Closed 13 years ago
#1649 closed New Feature (invalid)
Editor will not change the category
Reported by: | Brad F | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Project : MediaWiki+FCKeditor | Version: | |
Keywords: | Discussion | Cc: |
Description
If a page has a category entry, ex: category:animals, if you edit the page and type over the old category name with a new category name, such as reptiles, the category name does not change when you save the page.
Change History (5)
comment:1 Changed 17 years ago by
Component: | General → Project : MediaWiki+FCKeditor |
---|---|
Keywords: | category edit removed |
comment:2 Changed 17 years ago by
Keywords: | Confirmed added |
---|
comment:3 Changed 17 years ago by
Keywords: | Discussion added; Confirmed removed |
---|---|
Type: | Bug → New Feature |
I think it is not a bug.
To change the category, right-click with your mouse and change the link (category). What you see is the "Sort key" (http://meta.wikimedia.org/wiki/Help:Category).
This is not intuitive, so the default behaviour could be slight different:
if someone change the "Sort key" to Category:other
, we can assume that one wanted to change the category, not the sort key, and change it automatically.
Example: start with
[[Category:Ferrari]]
change the name to Category:Cars
in WYSIWYG mode, you should get
[[Category:Ferrari|Category:Cars]]
and the proposal is that it should be automatically converted into
[[Category:Cars]]
comment:4 Changed 17 years ago by
This will do it:
function replaceCategories($text){ $s1 = '/\[\[\s*[\w]*\s*:\s*[\w]*\s*\|\s*([\w]*)\s*:([\w\s]*)\]\]/'; $r1 = '[[$1:$2]]'; return preg_replace($s1, $r1, $text); } function fixCategories($parset, $text) { $text = replaceCategories($text); return true; } function fixCategoriesSave($article, $user, $text) { $text = replaceCategories($text); return true; } function fixCategoriesSaveConflict() { global $fckPageEditor; $fckPageEditor->textbox2 = replaceCategories($fckPageEditor->textbox2); $fckPageEditor->textbox1 = replaceCategories($fckPageEditor->textbox1); return true; } $wgHooks['ArticleAfterFetchContent'][] = 'fixCategories'; $wgHooks['ArticleSave'][] = 'fixCategoriesSave'; $wgHooks['EditPageBeforeConflictDiff'][] = 'fixCategoriesSaveConflict';
Please see bug http://dev.fckeditor.net/ticket/1385 for details regarding the "EditPageBeforeConflictDiff" hook.
comment:5 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Since FCKeditor is no longer supported and was replaced with CKEditor, active development of the MediaWiki extension and support for it are also finished.
I’m closing this ticket as it is no longer valid.
Confirmed - steps to reproduce:
1. Type this code in the Wikitext view
2. Go to WYSIWYG view and back to Wikitext again
3. Notice that the entry is changed to
which is an expected behavior.
4. Go back to WYSIWYG view and change the name from ex: category:animals to ex: category:reptiles
5. Switch to Wikitext again. You will see that the text is transformed to:
so only the viewable name is changed however the name of the category still remains the same.
The expected behavior would be for the editor to change it to