In the D7 branch currently, the module assumes that the only field to operate on is the "body" field. This is a carry-over from D6 where that was the only possible field. Now that we have the Field API in D7, the filtering can apply to any field. This needs to be generalized so that any field with a text format that has this filter enabled will be filtered. So we need to check for all relevant fields, and then apply the filtering to all of them.

This is a bug because an error is produced if that field doesn't exist.

Comments

colan’s picture

Adding tag.

colan’s picture

Status: Active » Fixed

I did some reorganizing and cleaning in these commits:

As far as actual coding, I was able to remove the hard-coding for the "body" field. All of the node's fields are now checked. What's even better is that I got it working for all languages and instances/multiples. The commit ID for this is fd56105.

Why just nodes? Core doesn't support an entity hook for this at this time. See #1537438: Allow non-node entity types to be tidied before editing for details.

Custom settings for the filter on each text format are not being picked up yet, but they are available. I'll get to this in #1536174: Custom filter settings aren't being loaded.

colan’s picture

Status: Fixed » Active

It's done for pre-editing (hook_node_prepare), just not post-editing (hook_node_validate). I'll get to that next.

colan’s picture

Status: Active » Fixed

The validation code is now up-to-date, and working. See these commits for details:

  1. dbb6727: Brought the validation function up to D7 standards
  2. f3ab12a: Moved the formats DB query to its own function
  3. 2b9f6b9: Wrapped the warning list in another array for theming

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

Anonymous’s picture

Issue summary: View changes

Added rationale for this being a bug.