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

bneil created an issue. See original summary.

bneil’s picture

Assigned: bneil » Unassigned
Status: Active » Needs review
StatusFileSize
new1.64 KB

Here's a patch that adds the filters into the $format object.

devin carlson’s picture

StatusFileSize
new425 bytes

A 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.

devin carlson’s picture

Might as well clean up the other locations where the filters were being retrieved manually.

devin carlson’s picture

Status: Needs review » Fixed

Tested #4 and committed to Editor 7.x-1.x.

  • Devin Carlson committed 5b9a65a on 7.x-1.x authored by bneil
    Issue #2610476 by Devin Carlson, bneil: Allowed and forbidden tags are...

Status: Fixed » Closed (fixed)

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