Mollom

29 August, 2008

AHAH-powered forms were virtually impossible in Drupal 5 (see the note though). In Drupal 6, this is much easier, thanks to the #ahah property. However, it still is really painful to actually use it.

The flaw {#flaw}

You have to write a menu callback for each AHAH-enabled form item of your form. You have to repeat small variations of this piece of code for each callback:

23 August, 2008

While working for Mollom, I faced the problem of needing multiple buttons with the same name. In my case, this was an absolute necessity on an advanced multi-step form. Sounds super … easy, right? But HTML doesn’t support this!

Thankfully, the combination of Drupal.behaviors and jQuery makes it easy to create a work-around! jQuery makes it easy to write the necessary code, Drupal.behaviors makes it trivial to ensure it keeps working even when new content has been added to the page (i.e. after an AHAH callback).

You would have a piece of Forms API code like this:

$form['step1']['edit'] = array(
  '#type'       => 'submit',
  '#value'      => t('Edit step 1'),
  '#submit'     => array('subscriptions_create_edit_step1'),
  '#attributes' => array('class' => 'edit-step-button'),
);

// … more form definition code

$form['step4']['edit'] = array(
  '#type'       => 'submit',
  '#value'      => t('Edit step 4'),
  '#submit'     => array('subscriptions_create_edit_step4'),
  '#attributes' => array('class' => 'edit-step-button'),
);

As you can see, nothing remarkable about this, except for one thing: we’ve set the class attribute. This is used in our Drupal.behaviors method to detect which buttons this behavior should be applied to.

25 July, 2008

As some of you may already know, I’m working for Mollom now (summer position).
The reasons for that should be obvious:

  • It’s Drupal work.
  • I get to work with Dries. No explanation needed here I think.
  • I get to work with Ben. Don’t know him? Remember this: he’s really smart and that shows in his machine learning skills and research (he’s got a Ph.D. in that field). He made Mollom’s algorithms outstanding.

So why I was I hired, without even having an interview?
Well, because certifications don’t say much about a person’s real skills. They only indicate a base level. Even college/university diplomas are becoming less valuable. It’s your real experience that matters. And you can see my real experience in my Drupal.org profile. You can tell that I have a lot Drupal experience, and you can find out the quality of my work by looking in my projects’ issue queues and the accompanying code.
That’s what really matters.

Tags

6 April, 2008

I’m late to the Mollom announcing party, because I was on a vacation. Nevertheless, I hope I can still interest some of you with a slightly different angle.

The major issue with spam prevention is that it often (currently virtually always) involves extra steps for normal users. And more steps means less participation. Less participation means less traffic. And less traffic means less popularity, revenue and whatnot. So clearly there is much to be gained to prevent spam without annoying normal users.

And this is exactly what Mollom tries to do: minimize spam and minimize annoyance. Additional benefits are that you no longer have to moderate content (nor users, because Mollom applies its magic on the user registration form as well), and – this one is pretty amazing IMO – ”improve the overall content quality”. Konstantin Käfer explained this pretty well:

Tags