Commit 0bd568ee authored by osman's avatar osman

Issue #3056630 Get cached filter formats, rather than querying database

parent 1da7413f
......@@ -108,17 +108,13 @@ function lazy_page_attachments(array &$attachments) {
*/
function lazy_is_enabled() {
$status = [];
$connection = \Drupal::database();
$query = $connection->query('SELECT c.name, c.data FROM {config} c WHERE c.name LIKE :format', [
':format' => 'filter.format.%',
]);
$filters = $query->fetchAllKeyed();
$filters = filter_formats();
foreach ($filters as $key => $filter) {
$filter = unserialize($filter);
if (
isset($filter['status'], $filter['dependencies']['module'])
&& $filter['status']
&& in_array('lazy', $filter['dependencies']['module'], TRUE)
$filter->status()
&& isset($filter->getDependencies()['module'])
&& in_array('lazy', $filter->getDependencies()['module'], TRUE)
) {
$status[$key] = TRUE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment