Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In function _css_injector_load_rule
, empty($cache->data)
evaluates to FALSE
if cache_get('css_injector:rules')
returns an empty array.
That leads to the execution of the second part of the structure, which does an unnecessary DB query and cache_set()
, which in turn have a negative impact on performance.
I would suggest to remove that condition, or replace it by is_array($cache->data)
, though I am not sure why it was added in the first place.
Comment | File | Size | Author |
---|---|---|---|
#4 | css_injector_load_rule_cache_empty-2759319-4.patch | 556 bytes | jfhovinne |
| |||
#2 | css_injector_load_rule_cache_empty-2759319-2.patch | 742 bytes | jfhovinne |
|
Comments
Comment #2
jfhovinne CreditAttribution: jfhovinne commentedHere is the patch.
Comment #3
jfhovinne CreditAttribution: jfhovinne commentedComment #4
jfhovinne CreditAttribution: jfhovinne commentedRemoved the annoying 'No newline at end of file' which causes a conflict during our profile build.
Comment #5
oresh CreditAttribution: oresh as a volunteer commented@jfhovinne thanks for your patch! I'll take a look and include the fix in the 7.1 dev
Comment #6
oresh CreditAttribution: oresh as a volunteer commentedComment #8
jfhovinne CreditAttribution: jfhovinne commented