[TxMt] Wordpress 2.2 and Pings/Comments

Joseph Scott joseph at automattic.com
Mon Jun 11 16:40:19 UTC 2007


On Jun 11, 2007, at 2:15 AM, Allan Odgaard wrote:

> On 11. Jun 2007, at 00:35, Christoph Koehler wrote:
>
>
> Joseph Scott: For context, the thread starts here: http:// 
> lists.macromates.com/pipermail/textmate/2007-June/020386.html -- I  
> have white-listed your address incase you want to follow-up to the  
> ML address (w/o being subscribed).
>
>
>>> Though it does sound like a WP bug.
>> I will post a bug report over at WP, will see if they can fix  
>> that. Where can I take a look to see what exactly is being sent to  
>> the server? That might help them debug it.
>
> Looking at the diff of xmlrpc.php between 2.1.3 and 2.2, it does  
> seem they broke it (or made some change I can’t really understand).
>
> Basically when you set comments: on/yes/y/1 in TextMate then we  
> send ‘mt_allow_comments=open’ to WordPress (to all other systems we  
> send ‘mt_allow_comments=1’).


Ahhh, sending a value of 'open' would certainly be the issue there.   
Before I go doctoring this up, is there list of all the potential  
values that are sent for mt_allow_comments?  Is it just 'open' and  
'closed'?



> WordPress 2.2 has the following line (and 2.1.3 has something  
> similar):
>
>     $allow_comments = ("open" == $page->comment_status) ? 1 : 0;
>
> So it seems they still expect us to send ‘open’ instead of ‘1’. But  
> then they also have this (new for 2.2):
>
>     $comment_status = (int) $content_struct["mt_allow_comments"];
>
> So here they basically coerce the ‘open’ string into an integer.  
> They do similar for pings. And just for the records:
>
>     % php -r 'echo (int)"open";'
>     0
>
> I have cc’ed Joseph Scott on this letter, he is involved with the  
> WordPress XML-RPC interface, so he might be able to comment as to  
> whether or not this is a bug.


The above looks about right.  With a little work I'm we'll be able to  
accommodate non-int values that are being sent, I'd like to know  
exactly what those are before I start adding more code though.

Thanks for bringing this to my attention.  I'm happy to work  
resolving any WordPress XML-RPC problems, bugs, feature questions, etc.

While I'm here, let me mention some of the basic documentation for  
the new wp.* XML-RPC methods:

http://codex.wordpress.org/XML-RPC_wp



--
Joseph Scott
http://joseph.randomnetworks.com/





More information about the textmate mailing list