Off-shoot from #558666: UX/security: Revamp text format/filter configuration:
The main API change, so we can revamp the user interface afterwards without having to touch the API.
Boils down to:
- Currently, filter settings are only displayed on separate pages, so we only ever need to retrieve all enabled filters.
- The new UI will remove those separate pages, which means that we need to handle enabled + disabled filters on the same page.
- Since that just means that we also want to get any additional, disabled filters, we simply add an argument to filter_list_format() that allows to retrieve all filters in a format, regardless of whether they are enabled.
I'm confident that #558666: UX/security: Revamp text format/filter configuration will hit core in the next few weeks, so this really is the API change only. The added foreach in the form submit handler will vanish when the other patch will be committed.
Comment | File | Size | Author |
---|---|---|---|
#4 | drupal.filter-list-format.4.patch | 9.13 KB | sun |
#2 | drupal.filter-list-format.2.patch | 6.76 KB | sun |
drupal.filter-retrieve-all.patch | 3.16 KB | sun | |
Comments
Comment #1
David_Rothstein CreditAttribution: David_Rothstein commentedSeems to make sense. I assume that as a minor API improvement, this could happen during the "code slush" period as well (i.e., does not need to get committed today)?
I think there is a bug, though. If you call filter_list_format() with $all = TRUE and then later call it with $all = FALSE, the second time will return the wrong information from the static cache. Seems like there needs to be a separate cache for the different values of $all.
Also, for the $all parameter, I'd suggest something more like this:
Comment #2
sunThanks!
I've merged some further clean-ups from #558666: UX/security: Revamp text format/filter configuration as well as #11218: Allow default text formats per role, and integrate text format permissions into this patch. Those two need to be re-rolled anyway.
While working on this patch, I realized that $filter is sometimes an array and sometimes an object. That should be consistent, and we should create separate issue for that (tagged with FilterSystemRevamp).
Comment #4
sunFixing the tests.
Comment #5
sunIntroducing a new tag for feature freeze: API clean-up.
Comment #6
Dries CreditAttribution: Dries commentedThis is a necessary API clean-up so I'm going to let this one go in.
How about $active_only instead of $include_disabled? This is a really minor suggestion. I'm also happy with $include_disabled. My original thought was, why not return all filters all the time with a status field, and have the caller sort it out, but this is probably a bit faster and makes the calling code slightly more elegant.
Happy to commit this 'as is' later today.
(PS: it looks like Dreditor picked up the wrong function in the snippet above.)
Comment #7
sunI promise to investigate the option to always return all filters and let check_markup() figure out which ones to apply.
But for now, this patch is required for both issues mentioned in #2.
Comment #8
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD.