Closed (fixed)
Project:
HTML Tidy
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
17 Apr 2012 at 01:18 UTC
Updated:
4 Jan 2014 at 01:39 UTC
Jump to comment: Most recent
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
Comment #1
colanCommitted 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.
Comment #2
colanI 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. ;)
Comment #3
colanAdding tag.
Comment #4
colanGot 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.