Filter Default module helps greatly, when posting from the site itself, however my writers like posting from offline blog editors like Live Writer. When posting from those (via blogapi) unfortunately still the globally default input type is used.

While I would like to see a proper fix, meanwhile I am ready to try somewhat dirty hacks :)

Thank you

CommentFileSizeAuthor
#2 filter_default.patch698 byteschellman

Comments

Mechanist’s picture

I have the same problem-- this module is so close to being exactly what I need, except that it doesn't seem to affect posting through an external editor (MarsEdit in my case).

My site default is filtered HTML, and I used this module to set the default for authenticated users to full HTML. That works great when posting through the site but has no effect when posting externally-- I get filtered HTML even as an authenticated user.

chellman’s picture

Status: Active » Needs review
StatusFileSize
new698 bytes

keathmilligan posted a code snippet for the (hopefully) upcoming D6 version of this module, and it seems like it works in the 5.x version as well. I've attached a patch you can use to test it.

chellman’s picture

Status: Needs review » Fixed

Okay, my patch didn't work, but that's okay. I've updated the CVS version so it works on new blogapi posts. I'm leaving blogapi edits alone because the input format could change elsewhere, so it shouldn't be reset to the default in that case. Here's what the function looks like:

/**
* Implementation of hook_nodeapi()
*
* Set the default filter on new blog posts coming in through blogapi module.
*/
function filter_default_nodeapi(&$node, $op) {
  if ($op == "blogapi new") {
    global $user;
    $roles = user_roles();
    for ($i = 1; $i < count($roles)+1; ++$i) {
      list($role, $format) = variable_get('filter_default_'. $i, array());
      if (array_key_exists($role, $user->roles)) {
        $node['format'] = $format;
        break;
      }
    }
  }
}
Drupalace-1’s picture

Thank you for the work, chellman. Though as I posted at http://drupal.org/node/282853#comment-995348 , I still get no luck using MarsEdit. : (

Mechanist, how about you? Have you had a chance to try out chellman's fix with MarsEdit?

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

adub’s picture

Anyone know how to extend that to include feedapi posts? ($op == 'feedapi new' doesn't work)

adub’s picture

Title: Does not work, when posting via blogapi » Does not work, when posting via blogapi (also feedapi)
adub’s picture

Status: Closed (fixed) » Active
chellman’s picture

Status: Active » Closed (fixed)

This is a different issue that would require some very different work, so please post a new feature request for it. I can tell you that feedapi doesn't call node_invoke_nodeapi(), which is what blogapi does to provide that $op.