Esanders has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371155 )

Change subject: CategoryCache: Don't assume that page.categories exists
......................................................................

CategoryCache: Don't assume that page.categories exists

Pages with no categories don't set the property. Conversely
we can assume page is an object (according to the documentation).

Change-Id: Ie3ef13d4ef03ac34ee34790005ec3d802cc1384f
---
M modules/cache/mw.cx.CategoryCache.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/55/371155/1

diff --git a/modules/cache/mw.cx.CategoryCache.js 
b/modules/cache/mw.cx.CategoryCache.js
index 2908b9b..94590c6 100644
--- a/modules/cache/mw.cx.CategoryCache.js
+++ b/modules/cache/mw.cx.CategoryCache.js
@@ -30,7 +30,7 @@
  */
 mw.cx.CategoryCache.static.processPage = function ( page ) {
        return {
-               categories: $.map( OO.getProp( page, 'categories' ), function ( 
item ) {
+               categories: ( page.categories || [] ).map( function ( item ) {
                        return item.title;
                } )
        };

-- 
To view, visit https://gerrit.wikimedia.org/r/371155
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie3ef13d4ef03ac34ee34790005ec3d802cc1384f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Esanders <esand...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to