r95971 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95970‎ | r95971 | r95972 >
Date:12:27, 1 September 2011
Author:catrope
Status:ok (Comments)
Tags:
Comment:
RL2: Kill a bunch of unneeded properties (covered in the JSON blob) in list=gadgets. We don't need to keep them around for back compat because list=gadgets was introduced in 1.18, as long as we update the 1.18 module to match the return format of this module (which I will do later)
Modified paths:
  • /branches/RL2/extensions/Gadgets/api/ApiQueryGadgets.php (modified) (history)

Diff [purge]

Index: branches/RL2/extensions/Gadgets/api/ApiQueryGadgets.php
@@ -92,36 +92,6 @@
9393 if ( isset( $this->props['desc'] ) ) {
9494 $row['desc'] = $g->getDescriptionMessage();
9595 }
96 - if ( isset( $this->props['desc-raw'] ) ) {
97 - $row['desc-raw'] = $row['desc'] = wfMessage( $g->getDescriptionMessageKey() )->plain();
98 - }
99 - if ( isset( $this->props['category'] ) ) {
100 - $row['category'] = $g->getCategory();
101 - }
102 - if ( isset( $this->props['resourceloader'] ) /*&& $g->supportsResourceLoader()*/ ) {
103 - // Everything supports resourceloader now :D
104 - // FIXME: We need to figure something out for legacy gadgets, or at least MaxSem thinks so
105 - $row['resourceloader'] = '';
106 - }
107 - if ( isset( $this->props['scripts'] ) ) {
108 - $row['scripts'] = $g->getScripts();
109 - $result->setIndexedTagName( $row['scripts'], 'script' );
110 - }
111 - if ( isset( $this->props['styles'] ) ) {
112 - $row['styles'] = $g->getStyles();
113 - $result->setIndexedTagName( $row['styles'], 'style' );
114 - }
115 - if ( isset( $this->props['dependencies'] ) ) {
116 - $row['dependencies'] = $g->getDependencies();
117 - $result->setIndexedTagName( $row['dependencies'], 'module' );
118 - }
119 - if ( isset( $this->props['rights'] ) ) {
120 - $row['rights'] = $g->getRequiredRights();
121 - $result->setIndexedTagName( $row['rights'], 'right' );
122 - }
123 - if ( isset( $this->props['default'] ) && $g->isEnabledByDefault() ) {
124 - $row['default'] = '';
125 - }
12696 $data[] = $row;
12797 }
12898 $result->setIndexedTagName( $data, 'gadget' );
@@ -151,14 +121,6 @@
152122 'timestamp',
153123 'definitiontimestamp',
154124 'desc',
155 - 'desc-raw',
156 - 'category',
157 - 'resourceloader',
158 - 'scripts',
159 - 'styles',
160 - 'dependencies',
161 - 'rights',
162 - 'default',
163125 ),
164126 ),
165127 'categories' => array(
@@ -184,18 +146,10 @@
185147 'prop' => array(
186148 'What gadget information to get:',
187149 ' name - Internal gadget name',
188 - ' json - JSON representation of the gadget metadata. All other prop attributes below are deprecated but provided for backwards compatibility',
 150+ ' json - JSON representation of the gadget metadata.',
189151 ' timestamp - Last changed timestamp of the gadget module, including any files it references',
190152 ' definitiontimestamp - Last changed timestamp of the gadget metadata',
191153 ' desc - Gadget description transformed into HTML (can be slow, use only if really needed)',
192 - ' desc-raw - Gadget description in raw wikitext',
193 - ' category - Internal name of a category gadget belongs to (empty if top-level gadget)',
194 - ' resourceloader - Whether gadget supports ResourceLoader',
195 - " scripts - List of gadget's scripts",
196 - " styles - List of gadget's styles",
197 - ' dependencies - List of ResourceLoader modules gadget depends on',
198 - ' rights - List of rights required to use gadget, if any',
199 - ' default - Whether gadget is enabled by default',
200154 ),
201155 'categories' => 'Gadgets from what categories to retrieve',
202156 'names' => 'Name(s) of gadgets to retrieve',

Follow-up revisions

RevisionCommit summaryAuthorDate
r96006Gadgets: To prevent back compat hacks in 1.19, change the Gadgets API to be c...catrope16:08, 1 September 2011

Comments

#Comment by Krinkle (talk | contribs)   15:33, 3 September 2011

Just reminder, needs backporting. We need to make sure that 1.18 (which introduced this API) is not released with these.

#Comment by Catrope (talk | contribs)   08:00, 5 September 2011

How did I not already do this in r96006?

#Comment by Krinkle (talk | contribs)   08:41, 5 September 2011

Indeed, I was looking in the wrong svn path. Marking OK :)

Status & tagging log