WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#8494 closed defect (bug) (fixed)

XMLRPC returns category name instead of category description

Reported by: zwettemaan Owned by: josephscott
Milestone: 2.7.1 Priority: normal
Severity: normal Version: 2.7
Component: XML-RPC Keywords: has-patch
Focuses: Cc:

Description

I am using the XML-RPC interface into wordpress, and when I use the wp.getCategories XML-RPC call, I get the category name twice in the returned data - instead of the category description, the category name is repeated.

The problem comes from the routine mw_getCategories inside xmlrpc.php - it reads:

function mw_getCategories($args) {
...

$structdescription? = $cat->name;
$structcategoryName? = $cat->name;

...

return $categories_struct;

}

whereas I'd expect it to be

function mw_getCategories($args) {
...

$structdescription? = $cat->description; <<<<<
$structcategoryName? = $cat->name;

...

return $categories_struct;

}

I checked the 2.7RC1 - the same problem exists there.

Is this a feature or a bug? Not sure how I should go about this - I am an old developer, but new to WordPress, so I don't know the proper 'etiquette' yet...

Attachments (2)

xmlrpc.php.diff (587 bytes) - added by josephscott 5 years ago.
xmlrpc.php.2.diff (644 bytes) - added by josephscott 5 years ago.

Download all attachments as: .zip

Change History (7)

josephscott5 years ago

comment:1 josephscott5 years ago

  • Cc josephscott added
  • Keywords has-patch added

Nice catch! I've uploaded a patch to fix this.

comment:2 ryan5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [10058]) Return description not name. Props josephscott. fixes #8494

comment:3 josephscott5 years ago

  • Milestone changed from 2.7 to 2.7.1
  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Version changed from 2.6.1 to 2.7

Turns out that the 'description' field is really the category name according the MetaWeblog API http://www.xmlrpc.com/metaWeblogApi

To keep MetaWeblog clients happy I've uploaded a patch that reverts this change (making 'description' show the category name again) and added a new field called 'categoryDescription' to show the actual WordPress category description.

josephscott5 years ago

comment:4 ryan5 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [10205]) Return cat name and description. Props josephscott. fixes #8494

comment:5 ryan5 years ago

(In [10206]) Return cat name and description. Props josephscott. fixes #8494 for 2.7

Note: See TracTickets for help on using tickets.