Commit 8a38e450 authored by profix898's avatar profix898

- bugfix: gallery pages not updated if page cache is enabled (#216775)

parent adefaf3d
......@@ -445,6 +445,19 @@ function gallery_page() {
return '';
}
/**
* Implementation of hook_exit().
*/
function gallery_exit() {
if (variable_get('cache', CACHE_DISABLED) != CACHE_DISABLED) {
// Drupal page cache is enabled, we need to flush the cache if a G2 item has been updated
$query = 'SELECT COUNT([GalleryEntity::id]) FROM [GalleryEntity] WHERE [GalleryEntity::modificationTimeStamp] > ?';
if (($results = gallery_db_query($query, array(time()-10))) && $results[0]) {
cache_clear_all();
}
}
}
/**
* Implementation of hook_xmlsitemap_links().
* (define additional links to add to the site map)
......
......@@ -729,7 +729,7 @@ function _gallery_install_step_usersync_skip($form, &$form_state) {
// Always sync (at least) the current user to avoid
// errors (unknown user) during GalleryEmbed::init()
gallery_user_modify($user, 'update', TRUE, array());
// Make sure the Drupal superuser (uid=1) always gets admin right
// Make sure the Drupal superuser (uid=1) always gets admin access
if ($user->uid != 1) {
gallery_user_modify(user_load(array('uid' => 1)), 'update', FALSE, array());
}
......
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