Given the following line of code:

$filter_settings = variable_get("htmltidy_filter_$format", array());

it is assumed that each filter configuration exists in a variable. This, however, is not the case. There are no such variables. Rather, the filter configuration needs to be collected from the context.

As a result of this bug, custom configuration is being ignored, and default settings are always loaded. For example, I set the executable path to "/usr/local/bin/tidy", but errors kept showing up in the logs stating the "/usr/bin/tidy" could not be found.

Comments

colan’s picture

Status: Active » Fixed

Committed in 9db79ee. I had to adds some NULLs in some instances when calling the main function just to get this up & running. Nothing is being lost here because the context never existed in those situations anyway. This will get filled in properly in future commits.

colan’s picture

Status: Fixed » Active

I need to get each filter's settings bundle passed in now that these are available from each field (thanks to #1536208: Only the "body" field is acted upon). NULLs won't really do the trick in the long term. ;)

colan’s picture

Adding tag.

colan’s picture

Status: Active » Fixed

Got this working for hook_node_prepare() (before editing), but it still needs to be fixed in hook_node_validate() (after editing). This will get fixed as part of the work in #1536208: Only the "body" field is acted upon.

I also simplified the function signature that does the processing. It had $filter and $format, but it really only needs $settings (along with the text itself and containers for errors and warnings.

Commit is 41bd468.

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