Help - Search - Members - Calendar
Full Version: XMLRPC and mt_convert_breaks
Movable Type Community Forum > Additional Resources > Tips and Tricks
ctarda
Hi!

I'm developing a little application to post to my movable type blogs, using the XMLRPC API.

Now, I'm able to create and publish posts, edit posts, set categories, .... but I'm not able to set the "Convert line breaks" property of a given post.

From the docs:

QUOTE
String mt_convert_breaks, the value for the convert_breaks field


That's my problem. I'm not able to set that value correctly. I don't know which values are possible.

I've tried [0,1] and [0, __default__], but without luck.

I'd appreciate any help or hint. Thanks!
shelley
I see either 0, 1, or __default__ in that field in my database table.
ctarda
Hi, Shelley, and thanks for your answer.

I've tried again to set that value as __default__ but without result.

I also saw the database values, so I was aware of it, but the problem seems to happen when posting through the XMLRPC api.

Here“s the XML I send when creating a new post:

CODE
<?xml version="1.0" encoding="utf-8"?>
<methodCall>
    <methodName>metaWeblog.newPost</methodName>
    <params>
 <param>
     <value><string>my_blog_id</string></value>
 </param>
 <param>
     <value><string>username</string></value>
 </param>
 <param>
     <value><string>password</string></value>
 </param>
 <param>
     <value>
   <struct>
       <member>
     <name>mt_convert_breaks</name>
     <value><string>__default__</string></value>
       </member>
       <member>
     <name>mt_allow_comments</name>
     <value><int>1</int></value>
       </member>
       <member>
     <name>mt_excerpt</name>
     <value><string></string></value>
       </member>
       <member>
     <name>mt_text_more</name>
     <value><string></string></value>
       </member>
       <member>
     <name>description</name>
     <value><string>First line
Second line
Third line</string></value>
       </member>
       <member>
     <name>title</name>
     <value><string>Post title</string></value>
       </member>
       <member>
     <name>selectedCat</name>
     <value><string>19</string></value>
       </member>
   </struct>
     </value>
 </param>
 <param>
     <value>
   <boolean>true</boolean>
     </value>
 </param>
    </params>
</methodCall>


I've included the complete xml just to see that it's wellformed, and so you could see its format.

The post is created, and I get as a return value de new postId. Other properties, like "allow_comments" are properly setted. But, I can't set "convert_breaks"

Thanks again,
shelley
Unfortunately, my technical skills don't currently extend to this area. So we'll need to wait until someone who's more familiar with doing this comes along to help out.
ctarda
Well, maybe the problem is not the mt_convert_breaks value, but the characters that are converted to
. Probably, the end of line characters I'm sending are not appropiate.

I've checked Entry.pm, to see which character is converted, but my knowledge of perl is very basic.

I think that the regular expresion searched is /\s*,\s*/, but I don't understand it.

Any help will be appreciated.

Thanks
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.