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 hook_init()
the module calls the below function which does a variable_set
for the blazy library installation status.
function lazy_is_library_installed() {
$blazy = libraries_detect('blazy');
variable_set('lazy_library_installed', $blazy['installed']);
return $blazy['installed'];
}
variable_set
writes data into the 'variable' table, and clears the entire variable cache on every page request.
At the very least, there should be a check to see if the current value of the variable matches the blazy library status, avoiding the need for a variable update.
Comment | File | Size | Author |
---|---|---|---|
#2 | variable_set-3035906-2.patch | 531 bytes | gianani |
Comments
Comment #2
gianani CreditAttribution: gianani at Iksula commentedThe below patch only updates the variable if its value has changed.
Comment #3
nikolas.tatianenko CreditAttribution: nikolas.tatianenko at EPAM Systems commentedComment #4
IreneV CreditAttribution: IreneV at EPAM Systems commentedReviewed and tested - works OK!
Comment #5
ram4nd CreditAttribution: ram4nd as a volunteer commentedComment #7
osmanThanks for the patch.