Opened 16 years ago
Closed 16 years ago
#10901 closed defect (bug) (worksforme)
wp.getPages gives different results if Blog pages show at most is changed to 1
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | XML-RPC | Keywords: | |
| Focuses: | Cc: |
Description
This comes up as a result of testing and working with the iPhone app. The ticket on the iPhone app is here: https://iphone.trac.wordpress.org/ticket/162
Briefly, output from the wp.getPages call appears to be different if the "Blog pages show at most" setting is changed to 1. This was tested and verified on a bare-bones wordpress.com blog.
In that case, the wp.getPages call appears to only return one page, regardless of the number of pages in the blog.
For convenience, the last post in the iPhone app ticket is included below. It includes a test to show this problem occuring outside of the iPhone app using an HTTP Client tool.
========
Resolving as "invalid" because the problem appears to be on the WP server itself. Naturally this should be added as a bug on the WP side, which I will do right after finishing this ticket.
Steps to reproduce this proof...
- Change Settings>Reading>Blog pages show at most to [1]
2 Using an HTTP Client, submit a wp.getPages post to the blog's rpc endpoint thus. (Obviously you'll need to your username, password and blog id number)
- Note that only one page comes back
- Change the setting on the Blog to 10 and try again
- Note that 10 pages now come back.
==========
To find this data for your blog(s), put the following line in XMLRPCEncoder.m : -encode just before the return statement at the end of the method. Put a breakpoint on that line, then compile the app, and delete and re-add your blog. Continue through the breakpoint several times (one for each different method call to the WP Server) and you will get the wp.getPages call on the 6th or 7th try.
The NSLog line will output the XML being used to build the XMLRPC request... You can then use copy/paste that into an HTTP client tool to test.
NSLog(@"buffer:: %@", buffer);
Post XML:
<?xml version="1.0"?>
<methodCall>
<methodName>wp.getPages</methodName>
<params>
<param>
<value>
<string>YourBlogIDNumber</string>
</value>
</param>
<param>
<value>
<string>YourUserName</string>
</value>
</param>
<param>
<value>
<string>YourPassword</string>
</value>
</param>
</params>
</methodCall>
Well the good news that I can't reproduce this on my test install of WP -trunk, so it's probably already been fixed. I need to test this with an older version of WP to confirm this.