The format object in editor_format_allowed_html() does not include the text format's filters. In Editor CKEditor, this results in the ACF settings not being generated correctly.
There's a core issue, #1304930: filter_format_load doesn't seem to populate $format->filters - bug or feature? that is related to this issue. In the meantime, I think adding
<?php
if (empty($format->filters)) {
$filters = filter_list_format($format->format);
// Build the $format->filters array.
$format->filters = array();
foreach($filters as $name => $filter) {
foreach($filter as $k => $v) {
$format->filters[$name][$k] = $v;
}
}
}
?>
In editor_format_allowed_html will consistently provide the filters. However, I'm not sure if this is the right location for it in the module.
Comments
Comment #2
bneil commentedHere's a patch that adds the filters into the $format object.
Comment #3
devin carlson commentedA patch to add filter information to the text format passed through
editor_format_ensure_additional_properties().I'd prefer to keep all of the hacks in one place until #1304930: filter_format_load doesn't seem to populate $format->filters - bug or feature? is fixed or we have some sort of filter load callback.
Comment #4
devin carlson commentedMight as well clean up the other locations where the filters were being retrieved manually.
Comment #5
devin carlson commentedTested #4 and committed to Editor 7.x-1.x.