Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With v4.4 of Wordpress, no longer able to pull categories #48

Open
ottadvantage opened this issue Dec 9, 2015 · 3 comments
Open

With v4.4 of Wordpress, no longer able to pull categories #48

ottadvantage opened this issue Dec 9, 2015 · 3 comments

Comments

@ottadvantage
Copy link

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 wpcats = wp.GetCategories();

Any thoughts on fixing this would be greatly appreciated.

@thompjake
Copy link

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 :)

@ottadvantage
Copy link
Author

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.

@Humbledonk
Copy link

Thanks thompjake, your solution worked right away!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants