Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F8104
bug31901_empty_api_query_elements.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 11:51 PM
2014-11-21 23:51:11 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
bug31901_empty_api_query_elements.patch
View Options
Index: ApiQuery.php
===================================================================
--- ApiQuery.php (Revision 98143)
+++ ApiQuery.php (Arbeitskopie)
@@ -458,19 +458,18 @@
ApiQueryBase::addTitleInfo( $vals, $title );
$pages[$pageid] = $vals;
}
-
- if ( count( $pages ) ) {
- if ( $this->params['indexpageids'] ) {
- $pageIDs = array_keys( $pages );
- // json treats all map keys as strings - converting to match
- $pageIDs = array_map( 'strval', $pageIDs );
- $result->setIndexedTagName( $pageIDs, 'id' );
- $result->addValue( 'query', 'pageids', $pageIDs );
- }
-
- $result->setIndexedTagName( $pages, 'page' );
- $result->addValue( 'query', 'pages', $pages );
+
+ // No check for count($pages): also generate empty lists
+ if ( $this->params['indexpageids'] ) {
+ $pageIDs = array_keys( $pages );
+ // json treats all map keys as strings - converting to match
+ $pageIDs = array_map( 'strval', $pageIDs );
+ $result->setIndexedTagName( $pageIDs, 'id' );
+ $result->addValue( 'query', 'pageids', $pageIDs );
}
+ $result->setIndexedTagName( $pages, 'page' );
+ $result->addValue( 'query', 'pages', $pages );
+
if ( $this->params['export'] ) {
$this->doExport( $pageSet, $result );
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
7630
Default Alt Text
bug31901_empty_api_query_elements.patch (1 KB)
Attached To
Mode
T33901: API: action=query with empty title set should still respond with "query" element
Attached
Detach File
Event Timeline
Log In to Comment