Last modified: 2014-03-10 10:01:12 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T61798, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 59798 - $wgCategoryTreeDynamicTag totally broken displaying no results
$wgCategoryTreeDynamicTag totally broken displaying no results
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
CategoryTree (Other open bugs)
unspecified
All All
: High blocker with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 59799 59887 59896 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-07 22:26 UTC by Asaf Bartov
Modified: 2014-03-10 10:01 UTC (History)
14 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Asaf Bartov 2014-01-07 22:26:49 UTC
Nothing is returned for categories.  This is a new issue, separate from the well-known caching issues in other CategoryTree bugs.

Nothing is returned whether you're logged in or out.

This page is supposed to have multiple pages listed under _each_ of the sections in it.  It is currently reproducibly empty for everyone.

https://meta.wikimedia.org/wiki/Grants:PEG/Index/Requests
Comment 1 Greg Grossmeier 2014-01-07 22:28:22 UTC
*** Bug 59799 has been marked as a duplicate of this bug. ***
Comment 2 Asaf Bartov 2014-01-07 22:31:57 UTC
This has rendered one of our grant programs completely invisible, to our community, our grantees, and our advisory committee members.  While we at WMF can navigate the raw categories and have internal listings anyway, it is seriously damaging to the grant program's ability to serve the community.  Hence the 'blocker' level. 

We really need a response ASAP.
Comment 3 Greg Grossmeier 2014-01-07 23:36:07 UTC
fixed, thanks Reedy
Comment 4 Sam Reed (reedy) 2014-01-07 23:36:50 UTC
Should be fixed now.

Seems there were some javascript related inconsistencies after we moved to a newer mediawiki version and revert back.
Comment 5 Asaf Bartov 2014-01-08 00:22:18 UTC
Nope, not fixed.

See https://meta.wikimedia.org/wiki/Grants:PEG/Index/Reports where pages still don't show up.  Note that in the meantime, we have switched from using CategoryTree to using DynamicPageList, which seems to meet our needs, on the Requests page (linked earlier).  

We will leave it like this for another 24 hours or so, to allow you to investigate if you're actively working on this.  (The requests page is working, thanks to DynamicPageList, the Reports page isn't, still using CategoryTree.)

If you can't or won't work on it this week, we'll just switch the Reports page to DynamicPageList as well, and then this bug can be de-prioritized, as far as we're concerned.
Comment 6 Sam Reed (reedy) 2014-01-08 01:18:23 UTC
(In reply to comment #5)
> Nope, not fixed.
> 
> See https://meta.wikimedia.org/wiki/Grants:PEG/Index/Reports where pages
> still
> don't show up.  Note that in the meantime, we have switched from using
> CategoryTree to using DynamicPageList, which seems to meet our needs, on the
> Requests page (linked earlier).  
> 
> We will leave it like this for another 24 hours or so, to allow you to
> investigate if you're actively working on this.  (The requests page is
> working,
> thanks to DynamicPageList, the Reports page isn't, still using CategoryTree.)
> 
> If you can't or won't work on it this week, we'll just switch the Reports
> page
> to DynamicPageList as well, and then this bug can be de-prioritized, as far
> as
> we're concerned.

For future reference, changing things like that after reporting bugs without mentioning it isn't exactly helpful
Comment 7 Sam Reed (reedy) 2014-01-08 01:26:04 UTC
Broken on 1.23wmf8 too.....
Comment 8 Sam Reed (reedy) 2014-01-08 01:55:17 UTC
Seems to work fine locally too. Even with

"Uncaught ReferenceError: categoryTreeExpandNode is not defined"
Comment 9 Sam Reed (reedy) 2014-01-08 02:01:16 UTC
Adding hideroot="on" hideprefix="on" changes it from expandnode to loadchildren error
Comment 10 Kunal Mehta (Legoktm) 2014-01-08 02:17:27 UTC
https://meta.wikimedia.org/w/index.php?title=Grants%3APEG%2FIndex%2FReports&diff=6992040&oldid=6770087

It's still throwing errors, but it works too...
Comment 11 Asaf Bartov 2014-01-08 02:49:42 UTC
Thanks, it does work now as-is (i.e. without hideroot).  We're fine with DynamicPageList, I think, so let us know when you're done investigating this (assuming CategoryTree won't suddenly become maintained code again), and we'll switch this page to DPL as well.
Comment 12 bamyers99 2014-01-11 14:56:19 UTC
*** Bug 59887 has been marked as a duplicate of this bug. ***
Comment 13 bamyers99 2014-01-11 15:11:41 UTC
The $wgCategoryTreeDynamicTag option is not working. See https://www.mediawiki.org/wiki/Extension:CategoryTree#Configuration When the javascript was refactored to use jQuery, some of the code did not get refactored.

In CategoryTreeFunctions.php

line 447 categoryTreeLoadChildren - old function name

line 846 categoryTreeExpandNode - old function name

Test page: https://en.wikipedia.org/wiki/User:Bamyers99/sandbox/LV
Comment 14 db [inactive,noenotif] 2014-01-11 20:00:19 UTC
*** Bug 59896 has been marked as a duplicate of this bug. ***
Comment 15 bamyers99 2014-01-11 23:05:08 UTC
Here is my analysis of what happened.

On January 6, 2014, CommonSettings.php was changed here: https://git.wikimedia.org/commitdiff/operations%2Fmediawiki-config.git/4de2857061bc79128dc429f2aac6964a86c8f38a

Before the change, CommonSettings.php looked like this:
$wgCategoryTreeDynamicTag = true;	
require( $IP . '/extensions/CategoryTree/CategoryTree.php' );

Currently it looks like this:
require( $IP . '/extensions/CategoryTree/CategoryTree.php' );
$wgCategoryTreeDynamicTag = true;

Before the change, setting $wgCategoryTreeDynamicTag = true had no effect because it was set before the require statement and CategoryTree.php sets it back to the default of false.

Since the $wgCategoryTreeDynamicTag feature is broken, setting it to true has caused issues.

Can we get $wgCategoryTreeDynamicTag set back to false in CommonSettings.php until this bug is fixed?
Comment 16 Gerrit Notification Bot 2014-01-12 00:01:18 UTC
Change 107008 had a related patch set uploaded by Reedy:
Remove $wgCategoryTreeDynamicTag = true

https://gerrit.wikimedia.org/r/107008
Comment 17 Gerrit Notification Bot 2014-01-12 00:03:13 UTC
Change 107008 merged by jenkins-bot:
Remove $wgCategoryTreeDynamicTag = true

https://gerrit.wikimedia.org/r/107008
Comment 18 Andre Klapper 2014-01-13 10:21:39 UTC
bamyers99: Thanks for your comment and investigation, this was very helpful!

https://gerrit.wikimedia.org/r/#/c/107008/ has been merged - closing as FIXED.
Comment 19 Nemo 2014-01-13 15:19:36 UTC
Reverted: https://gerrit.wikimedia.org/r/#/c/107158/
Comment 21 Faidon Liambotis 2014-01-13 15:39:34 UTC
extensions/CategoryTree/CategoryTreeFunctions.php has this piece of code:

  if ( $parser && $wgCategoryTreeDisableCache && !$wgCategoryTreeDynamicTag ) {
          $parser->disableCache();
  }

(with $wgCategoryTreeDisableCache having a value of true, its default)
Comment 22 bamyers99 2014-01-13 16:04:26 UTC
Sorry, I did not see this commit:
https://git.wikimedia.org/commitdiff/operations%2Fmediawiki-config.git/670fe932d04b948c1aa73033a00a722fc0269c9e

I thought that $wgCategoryTreeDisableCache = false;
was still in CommonSettings.php.
Comment 23 Sam Reed (reedy) 2014-01-13 18:39:40 UTC
[17:08:10] <Reedy> I'm confused how CategoryTree didn't cause problems before
[17:08:11] <Reedy> https://github.com/wikimedia/operations-mediawiki-config/commit/4de2857061bc79128dc429f2aac6964a86c8f38a
[17:08:26] <Reedy> $wgCategoryTreeDynamicTag was set before the require
[17:08:32] <Reedy> So it wouldn't have had any effect at all
[17:08:48] <Reedy> I "fixed" that, which apparently broke some configurations
[17:09:01] <Reedy> But then removing it (so it was the same as original) and it causes major problems?
Comment 25 Karmela 2014-01-20 15:10:28 UTC
At hu.wiki the empty categorytree has been noticed too. Our mentor-system depends on it. Do we need to develop a workaround, or will the bug be fixed soon? ~~~~
Comment 26 bamyers99 2014-01-20 16:13:43 UTC
I have implemented a workaround at https://en.wikipedia.org/wiki/Wikipedia_talk:WikiProject_Geographical_coordinates/to_do#Fix

Example:
<categorytree class="toccolours" namespaces="- Talk" style="margin:0 1ex;">Articles requiring geodata verification</categorytree>
:{{PAGESINCATEGORY:Articles requiring geodata verification|pages}} pages
Comment 27 bennylin 2014-01-22 09:05:57 UTC
We're in id.wp also noticed this, and we're going to watch this progress too. Fortunately no major damage is done.
Comment 28 bennylin 2014-02-04 18:52:37 UTC
Hi, I've made a use case in https://id.wiktionary.org/wiki/Pengguna:Bennylin/Categorytree, because id.wikt relies heavily on CategoryTree to display phrases that uses the lemma. 

Any update on this bug?
Comment 29 Andre Klapper 2014-02-05 15:16:43 UTC
Greg: Do you know if somebody in Engineering has expertise to give fixing this ticket another shot?
Comment 30 spage 2014-02-09 09:38:40 UTC
renderNode() in CategoryTreeFunctions.php may insert a <script> tag that calls categoryTreeExpandNode().  See
https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FCategoryTree/05bafcafdbd3e5b959dba593b8656c24ef0d4a54/CategoryTreeFunctions.php#L846

but as Reedy notes there's no such function.  categoryTreeExpandNode and categoryTreeLoadChildren used to be defined in CategoryTree.js, but that file was deleted in 2011. 

This is indirectly causing a problem with Flow, see bug 61097. Flow can somehow render subst'd page content with this script tag and then JS processing halts with
    ReferenceError: categoryTreeExpandNode is not defined

FWIW Flow boards don't load the JS module 'ext.categoryTree'. Maybe when that module is loaded it masks the problem. But it can't be good to invoke deleted functions :)
Comment 31 Gerrit Notification Bot 2014-02-19 12:15:37 UTC
Change 114142 had a related patch set uploaded by Brian Wolff:
Unbreak this extension by killing $wgCategoryTreeDynamicTag

https://gerrit.wikimedia.org/r/114142
Comment 32 Greg Grossmeier 2014-02-19 22:31:46 UTC
S: Can the Flow team take this on as a "help other parts of the ecosystem and also Flow at the same time" task? Or is Brian's "just kill it" solution acceptable?
Comment 33 Bawolff (Brian Wolff) 2014-02-19 23:26:04 UTC
(In reply to Greg Grossmeier from comment #32)
> S: Can the Flow team take this on as a "help other parts of the ecosystem
> and also Flow at the same time" task? Or is Brian's "just kill it" solution
> acceptable?

To be clear, my solution doesnt actually remove any functionality, it just loads things statically in the page, instead of dynamically by ajax (for the first level, other levels still dynamic). This has some affect on how long cache works (so possibly stale entries, but only up to 6 hours), but ive been hearing rumours that the ajax response is also getting cached longer than expected (unconformed, might be totally untrue), so this solutiion might not even cause (new) problems in that regard.
Comment 34 Gerrit Notification Bot 2014-02-20 01:15:06 UTC
Change 114142 merged by jenkins-bot:
Unbreak this extension by killing $wgCategoryTreeDynamicTag

https://gerrit.wikimedia.org/r/114142
Comment 35 MZMcBride 2014-03-03 17:18:41 UTC
(In reply to Gerrit Notification Bot from comment #34)
> Change 114142 merged by jenkins-bot:
> Unbreak this extension by killing $wgCategoryTreeDynamicTag
> 
> https://gerrit.wikimedia.org/r/114142

Is this bug fixed, then?
Comment 36 Bawolff (Brian Wolff) 2014-03-03 17:46:43 UTC
Yes, fixed and deployed.

If someone really wanted to they could still rewrite the old code to load entirely dynamically, but if anyone actually wants that they can file another bug.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links