Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is a problem with CVS blogapi, and how blog API clients know what input filter is used for each post. Currently, no information is sent -- the field is blank. Here is an email from the MarsEdit author regarding the problem:
When getting recent posts, the value for the text filter field for each post is always an empty string. For historical reasons, the text filter field name is mt_convert_breaks -- and it's always an empty string in the XML-RPC response, like this:
<member><name>mt_convert_breaks</name>
<value><string></string></value>
It should instead contain the identifier of the text filter. For instance, on your site, the Markdown With SmartyPants filter has an identifier of 1. So for a post that uses that filter, the XML should look like this:
<member><name>mt_convert_breaks</name>
<value><string>1</string></value>
Comment | File | Size | Author |
---|---|---|---|
#11 | blogapi_query.patch | 1.79 KB | Zen |
#6 | blogapi_node_settings.patch_0.txt | 1.95 KB | Heine |
#5 | blogapi_node_settings.patch.txt | 1.94 KB | Heine |
#4 | 12984_blogapi.patch | 1.2 KB | snej |
Comments
Comment #1
walkah CreditAttribution: walkah commentedi
Comment #2
Uwe Hermann CreditAttribution: Uwe Hermann commentedwalkah, are you still working on this? Any progress?
Comment #3
snej CreditAttribution: snej commentedI independently discovered this problem last night (with Ecto), tracked down the cause, and fixed it.
In blogapi.module, the function blogapi_blogger_get_recent_posts() runs a custom SELECT query to get the nodes. Unfortunately it's missing the 'format' and 'comment' columns, so when the rows get passed to _blogapi_get_post(), it generates empty strings for the XML-RPC 'mt_convert_breaks' and 'mt_allow-comments' attributes.
The fix is simply to amend the query string to add the missing columns. Here's a patch for Drupal 4.6.5's blogapi.module:
I haven't contributed to Drupal before so I'm not totally clear on the process for submitting fixes/patches yet. I'll save this, then go read up on the procedures -- looks like I'll need to check out CVS and submit a patch against that. In the meantime I'll set the status to "patch (code needs work)" even though it's the patch, not the code, that needs the work :-)
Comment #4
snej CreditAttribution: snej commentedOK, here [attached] is a patch against top-of-tree CVS. I haven't run the CVS version yet, so this definitely needs to be tested. However, it's just a one-line change to add two columns to a SQL query. I did notice that the 'format' column has been moved from the node table to node_revisions, so I changed my 'n.format' to 'r.format'.
Comment #5
Heine CreditAttribution: Heine commentedRerolled to apply against head + extra bugfixes.
Comment #6
Heine CreditAttribution: Heine commenteda little change
Comment #7
Heine CreditAttribution: Heine commentedfor the record, posting won't work due to a seperate issue: http://drupal.org/node/80271
Comment #8
Dries CreditAttribution: Dries commentedFixed look good, but I wonder whether using $node->format makes sense? It doesn't mean that we have to break linebreaks, have we? Wouldn't that depend on the configuration of the format itself?
Comment #9
walkah CreditAttribution: walkah commentedRTBC - the patch from #6 is good.
@Dries - the parameter (while questionably named) is used to denote which MT filter to utilize - which is analogous to a drupal input format.
Comment #10
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Needs to be backported to Drupal 4.7, I think.
Comment #11
Zen CreditAttribution: Zen commentedBackport attached. Untested.
-K
Comment #12
Zen CreditAttribution: Zen commentedSetting backport to RTBC.
Comment #13
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedapplied
Comment #14
(not verified) CreditAttribution: commented