Textpattern bug: Post editing results in 404
  • Hi,

    I recently had some problems with posts I made from MarsEdit to my Textpattern blog. Today I realized it seemed to occur only when I edited a post. This would then result in a 404/Not found on my blog, even though the entry would still be in the DB and the textpattern article list. Saving the same article once more in the blogs backend resolves the error.
    I'm not sure if it's a problem with the rudimentary RPC-support from textpattern or something else, but it would be great if you could look into it.

    p.s.
    Congratulations!


    ----------------------
    Textpattern ยท 4.0.4
    Mars Edit 1.1.8 (334)

    RPC Console (don't know if of any help)

    RPC message sent: 2007-05-20 22:15:13 +0200
    URL: http://blog....
    Method name: metaWeblog.editPost
    RPC reply received: 2007-05-20 22:15:14 +0200
    URL: http://blog....
    Method name: metaWeblog.editPost
    Status code: 200
    Succeeded: YES
    Request text:
    <?xml version="1.0" encoding="utf-8"?>

    metaWeblog.editPost


    [postID]


    [username]


    [password]





    flNotOnHomePage
    0


    categories



    [category]





    description
    [Some Text and links from the article here]


    link
    [article url]


    title
    [article title]





    1




    Response text:
    <?xml version="1.0" encoding="utf-8" ?>




    1



  • Hi Davus - thanks for the congrats :)

    The RPC console you pasted isn't too helpful because it doesn't show the 404 error you were describing. Are you sure that the RPC console wasn't cleared after the error occurred? The log you pasted looks like a successful edit.

    Daniel
  • Sorry, me again, but I think I'fe found the problem. The edited article has now url-title in the DB, i.e. if I understand it correctly the permalink url. (http://rpc.textpattern.com/help/?item=url_title). Still now idea on why this happens ;)

    Geez you're fast!

    Daniel Jalkut said:
    The log you pasted looks like a successful edit.
    Daniel

    Definitely, but there's something odd: the edited entries (and the new ones, I just tried it out) have a feed time of: 1969-12-31 in the DB. The posted field has the correct date and time so no damage done. It's weired nonetheless. :/
  • I'm not completely clear on the problem, since I'm not all that familiar with TextPattern. Are you still concerned it might be something to do with MarsEdit?
  • Well, I'm not particularly familiar with the textpattern RPC-bundle (who am I kidding, I have no idea at all) so I thought it would be best to ask the person who's actually developing my favorite blogging client and knows more than I do. :)
    If you tell me that it's got nothing to do with MarsEdit then I will just curse the makers of the textpattern rpc bundle. (I just don't want to switch to Wordpress. I'm using it on another blog but on this one I'm happy with Textpattern, except for the lacking xml-rpc support...)

    Sorry to have bothered you.
    And thanks for the wonderful app, btw. Keep up the great work.
  • Heh - I'm glad to look into it a bit more - but can you get me a copy of the RPC console where the failure actually happens? Or did it turn out not to be a 404 error?
  • There's no real (?) error in the RPC console, but on my blog when I try to read the edited article. MarsEdit seems to work just fine, but in my database, the edited article lose his url. Using article ID's instead of the url would probably resolve be a workaround for this, but you know, I somehow like it this way. ;)

    So I tried once more with an empty RPC console, here's what I get

    RPC message sent: 2007-05-21 10:00:35 +0200
    URL: http://blog.davus.it/rpc/index.php
    Method name: metaWeblog.editPost
    RPC reply received: 2007-05-21 10:00:37 +0200
    URL: http://blog.davus.it/rpc/index.php
    Method name: metaWeblog.editPost
    Status code: 200
    Succeeded: YES
    Request text:
    <?xml version=\"1.0\" encoding=\"utf-8\"?>
    <methodCall>
    <methodName>metaWeblog.editPost</methodName></cite>

    correct url:
    <member>
    <name>link</name>
    <value><string>http://blog.davus.it/eigene-sache/erneuerung</string></value>
    </member>
    </params>
    </methodCall>

    Now the interesting part (imho):
    Response text:

    Method name: metaWeblog.getPost
    Status code: 200
    Succeeded: YES
    Request text:
    <?xml version=\"1.0\" encoding=\"utf-8\"?>
    <methodCall>
    <methodName>metaWeblog.getPost</methodName>(...)</methodCall>

    Response text:
    <?xml version=\"1.0\" encoding=\"utf-8\" ?>
    (...) <member><name>dateCreated</name><value><dateTime.iso8601>20070520T21:08:43</dateTime.iso8601></value></member>
    <member><name>link</name><value><string>http://blog.davus.it/eigene-sache/</string></value></member>
    <member><name>permaLink</name><value><string>http://blog.davus.it/eigene-sache/</string></value></member>
    <member><name>title</name><value><string>Erneuerung</string></value></member>
    (...)
    </struct>

    Any idea why the article part of the url disappears?
    ("eigene-sache" is just the section...)
  • Hm!! Very interesting indeed. Now I finally get it :) I just went to your blog and see the obvious failure. It's funny that it shows up in the front-page but even when you click on the link there, it shows the not found error.

    I am definitely leaning towards this being a problem in TextPattern. Not sure how you could work around it, as long as MarsEdit is following the "contract" for the interaction, it's up to TextPattern to behave.

    Just one last thing to confirm. In your RPC log you naturally only captured the "edit" portion of the interaction. The only other thing to confirm would be to see that the [PostID] returned by the original "newPost" call (when you first post an entry) matches the [PostID] that MarsEdit is supplying when you edit the post. If that matches, then I think it's fairly safe to say this is a TextPattern problem :(
  • One more thing to try: have you tried setting the API as "MovableType" instead of MetaWeblog? It might work well for TextPattern depending on the version you're running.
  • Daniel Jalkut said:
    Just one last thing to confirm. In your RPC log you naturally only captured the "edit" portion of the interaction. The only other thing to confirm would be to see that the [PostID] returned by the original "newPost" call (when you first post an entry) matches the [PostID] that MarsEdit is supplying when you edit the post. If that matches, then I think it's fairly safe to say this is a TextPattern problem

    The IDs actually match. And a switch to the MovableType Api doesn't do it - but I keep discovering some neat features (excerpt, keywords, textile) :)
    I guess I have to write my articles perfectly before publishing them.
    Thinking about it, that's a nice feature that might even improve my writing :D
  • Now *that's* looking on the bright side :)
  • I think I've had the exact same problem as davus has experienced. Davus, have you posted on the Textpattern forum about this issue, too?
  • Daniel Jalkut said:
    Now *that's* looking on the bright side :)

    Sure thing, that's the italian spirit: if something isn't working: get creative and find a workaround...

    ncaldwell said:
    Davus, have you posted on the Textpattern forum about this issue, too?

    No, I totally forgot. Did you already? Well, I'll head over there now and se what I can find.

    Update:
    Now there's a post in the Textpattern forum.
    http://forum.textpattern.com/viewtopic.php?id=22642
  • I followed the link and it came up as a "Bad request". What section did you post into? I'll weigh in when I can find the post :-)

    Gotta admit that Simplelog is looking better and better.
  • Ah, sorry, I wasn't logged in when I followed the link. I can find the post now.
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!