See benwei's sleuth work here.

http://drupal.org/node/53899

He uncovered a bug for a contrib module (basicevent) but this will become a bug w/ numerous contrib modules, I believe.
The reason is that as of Drupal 4.7 beta 5 or 6, this produces as error:

function mymodule_form(&$node) {
  ...
  return array_merge($form, filter_form($node->format));
} 

So assuming the recent changes to core filter/validation functions are here to stay, you could conclude there is a bug in drupaldocs, node_example.module code. Since many contrib modules use this as a template, I believe many/all such modules will now break.

http://drupaldocs.org/api/head/file/contributions/docs/developer/example...
return array_merge($form, filter_form($node->format));

I gather that anybody who has copied or will copy node_example.module as a start to their new node will have this bug.

To fix my contrib module, I used benwei's lead and changed the above offending line of code to
$form['format'] = filter_form($node->format);

Not sure if this works for all cases. My node module's form validation is still working

Comments

sime’s picture

Project: Drupal core » Drupal.org site moderators
Component: filter.module » web site
Category: bug » task

you could conclude there is a bug in drupaldocs, node_example.module code

I'll trust your conclusion on face value, and suggest that this is not a bug in Drupal core. I'm assigning this to drupal.org maintenance as it seems to be about updating node_example.module and helping contrib developers update their modules.

dado’s picture

agreed

webchick’s picture

Just a note that anyone with a CVS account can update this file.

It's in docs/developer/examples/node_example.module.

dave reid’s picture

Project: Drupal.org site moderators » Documentation
Version: 4.7.0-beta6 »
Component: web site » Correction/Clarification
Status: Active » Fixed

Looks like it has already been fixed. If not, re-open.

jhodgdon’s picture

Project: Documentation » Drupal core
Version: » 6.x-dev
Component: Correction/Clarification » documentation

I agree it is fixed in both D5 and D6 versions of the example module (the D7 version needs a total rewrite, and there's a separate issue on that).

But as this is API documentation, if someone wants to reopen, let's get it into the correct queue.

Status: Fixed » Closed (fixed)

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