JoeBlogs
JoeBlogs copied to clipboard
With v4.4 of Wordpress, no longer able to pull categories
After upgrading our sites to v4.4 of Wordpress, our application that uses JoeBlogs dll is failing with the following error:
response contains int value where string expected [response : array mapped to type XmlRpcCategory[] : element 0 : struct mapped to type XmlRpcCategory : member categoryId mapped to type String]
This occurs when trying to get the list of categories available on a site using following:
IEnumerable<Category> wpcats = wp.GetCategories();
Any thoughts on fixing this would be greatly appreciated.
wordpress use to return the ID as a string, now its returned as an int. Same with parentId.
The XmlRpcCategory needs the types changed for those... Should look like this:
public struct XmlRpcCategory
{
public int categoryId;
public int parentId;
public string categoryDescription;
public string categoryName;
public string title;
public string htmlUrl;
public string rssUrl;
}
notice description is now categoryDescription also...
EDIT: Just saw you made the changes already :)
Yeah, ended up adjusting the XmlRpcCategory struct to reflect the int.
Also discovered that the tag_id in XmlRpcTagInfo is also now an int as well.
Ended up needing to make changes to mapper.cs as well to reflect these changes.
Didn't catch the categoryDescription change in that structure. Thanks so much, I'll make that change in my fork.
Thanks thompjake, your solution worked right away!