Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/make/administration.make
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ projects[variable][version] = "2.5"

projects[ds][subdir] = "contrib"
projects[ds][version] = "2.15"
projects[ds][patch][] = "https://www.drupal.org/files/issues/2018-04-05/ds-additional-settings-2958822-3.patch"

projects[flag][subdir] = "contrib"
projects[flag][version] = "3.9"
Expand Down
1 change: 1 addition & 0 deletions config/make/fields.make
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ projects[dragndrop_upload][version] = "1.x-dev"

projects[field_group][subdir] = "contrib"
projects[field_group][version] = "1.6"
projects[field_group][patch][] = "https://www.drupal.org/files/issues/2018-04-05/field_group-additional-settings-2512066-15.patch"

projects[geocoder][subdir] = "contrib"
projects[geocoder][version] = "1.3"
Expand Down
6 changes: 6 additions & 0 deletions config/make/performance.make
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ api = 2
projects[memcache][subdir] = "contrib"
projects[memcache][version] = "1.5"

projects[display_cache][subdir] = "contrib"
projects[display_cache][version] = "1.3"
projects[display_cache][patch][] = "https://www.drupal.org/files/issues/display_cache-alter-entity-settings-2534466-1.patch"
projects[display_cache][patch][] = "https://www.drupal.org/files/issues/display_cache-replace-node_page_view-2489098-2.patch"
projects[display_cache][patch][] = "https://www.drupal.org/files/issues/undefined_index_in-2715995-3.patch"

projects[chained_fast][subdir] = "contrib"
projects[chained_fast][version] = "1.0-beta1"

Expand Down
1 change: 1 addition & 0 deletions project/profiles/capacity4more/capacity4more.info
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies[] = date
dependencies[] = date_popup
dependencies[] = diff
dependencies[] = draggableviews
dependencies[] = display_cache
dependencies[] = entity
dependencies[] = entity_token
dependencies[] = entityreference
Expand Down
7 changes: 7 additions & 0 deletions project/profiles/capacity4more/capacity4more.install
Original file line number Diff line number Diff line change
Expand Up @@ -664,3 +664,10 @@ function capacity4more_update_7015() {
}
drupal_uninstall_modules($modules);
}

/**
* Enable display_cache module.
*/
function capacity4more_update_7016() {
module_enable(['display_cache']);
}
Original file line number Diff line number Diff line change
Expand Up @@ -1564,3 +1564,56 @@ function c4m_content_batch_update_aliases(array &$sandbox, $url_prefix, $type) {
'@max' => $sandbox['max'],
]);
}

/**
* Implements hook_flag_flag().
*/
function c4m_content_flag_flag($flag, $entity_id, $account, $flagging) {
c4m_content_clear_display_cache_on_recommendation($flag, $entity_id, $account, $flagging);
}

/**
* Implements hook_flag_unflag().
*/
function c4m_content_flag_unflag($flag, $entity_id, $account, $flagging) {
c4m_content_clear_display_cache_on_recommendation($flag, $entity_id, $account, $flagging);
}

/**
* Clears a node display cache when it is (un)recommended.
*/
function c4m_content_clear_display_cache_on_recommendation($flag, $entity_id, $account, $flagging) {
if ($flagging->entity_type !== 'node') {
return;
}
if ($flagging->flag_name !== 'c4m_og_content_recommend') {
return;
}
$node = node_load($flagging->entity_id);
c4m_content_clear_display_cache($node);
}

/**
* Clears a node cache.
*
* @param object $node
* The node.
*
* @see display_cache_clear_comment_host_entity_cache()
*/
function c4m_content_clear_display_cache($node) {
$should_clear_host_entity_cache_globally = variable_get('display_cache_comment_publication_clears_host_entity_cache_' . $node->type, FALSE);

$view_modes_to_clear = display_cache_get_comment_publication_clears_host_entity_cache_settings('node', $node->type);

if ($should_clear_host_entity_cache_globally) {
display_cache_flush_cache('node', $node);
}
elseif (!empty($view_modes_to_clear) && array_sum($view_modes_to_clear) > 0) {
foreach ($view_modes_to_clear as $view_mode => $clear) {
if ($clear) {
display_cache_flush_cache('node', $node, $view_mode);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @file
* c4m_content_article.ds.inc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @file
* c4m_content_article.features.field_base.inc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @file
* c4m_content_article.features.field_instance.inc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @file
* c4m_content_article.features.inc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @file
* c4m_content_article.field_group.inc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ features[variable][] = comment_default_per_page_article
features[variable][] = comment_form_location_article
features[variable][] = comment_preview_article
features[variable][] = comment_subject_field_article
features[variable][] = display_cache_comment_publication_clears_host_entity_cache_node_article
features[variable][] = display_cache_node_article_default
features[variable][] = display_cache_node_article_full
features[variable][] = field_bundle_settings_comment__comment_node_article
features[variable][] = field_bundle_settings_node__article
features[variable][] = menu_options_article
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @file
* c4m_content_article.strongarm.inc
Expand Down Expand Up @@ -59,6 +60,95 @@ function c4m_content_article_strongarm() {
$strongarm->value = 0;
$export['comment_subject_field_article'] = $strongarm;

$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'display_cache_comment_publication_clears_host_entity_cache_node_article';
$strongarm->value = array(
'activity_global' => 1,
'teaser' => 1,
'default' => 1,
'full' => 0,
'block_list' => 1,
);
$export['display_cache_comment_publication_clears_host_entity_cache_node_article'] = $strongarm;

$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'display_cache_node_article_default';
$strongarm->value = array(
'default' => array(
'use' => '1',
'page_granularity' => '0',
'user_granularity' => '1',
'granularity' => '1',
),
'c4m_body' => array(
'override' => '2',
'page_granularity' => '0',
'user_granularity' => '1',
'granularity' => '1',
),
);
$export['display_cache_node_article_default'] = $strongarm;

$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'display_cache_node_article_full';
$strongarm->value = array(
'default' => array(
'use' => '0',
'page_granularity' => '0',
'user_granularity' => '0',
'granularity' => '0',
),
'c4m_vocab_topic' => array(
'override' => '2',
'page_granularity' => '0',
'user_granularity' => '0',
'granularity' => '0',
),
'c4m_vocab_geo' => array(
'override' => '2',
'page_granularity' => '0',
'user_granularity' => '0',
'granularity' => '0',
),
'c4m_related_group' => array(
'override' => '2',
'page_granularity' => '0',
'user_granularity' => '0',
'granularity' => '0',
),
'c4m_related_articles' => array(
'override' => '2',
'page_granularity' => '0',
'user_granularity' => '0',
'granularity' => '0',
),
'c4m_body' => array(
'override' => '2',
'page_granularity' => '0',
'user_granularity' => '0',
'granularity' => '0',
),
'c4m_related_user' => array(
'override' => '2',
'page_granularity' => '0',
'user_granularity' => '0',
'granularity' => '0',
),
'c4m_link_multiple' => array(
'override' => '2',
'page_granularity' => '0',
'user_granularity' => '0',
'granularity' => '0',
),
);
$export['display_cache_node_article_full'] = $strongarm;

$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ features[variable][] = comment_discussion
features[variable][] = comment_form_location_discussion
features[variable][] = comment_preview_discussion
features[variable][] = comment_subject_field_discussion
features[variable][] = display_cache_comment_publication_clears_host_entity_cache_node_discussion
features[variable][] = display_cache_node_discussion_activity_global
features[variable][] = display_cache_node_discussion_activity_group
features[variable][] = display_cache_node_discussion_block_list
features[variable][] = display_cache_node_discussion_default
features[variable][] = display_cache_node_discussion_full
features[variable][] = display_cache_node_discussion_highlight_list
features[variable][] = display_cache_node_discussion_pinned_content
features[variable][] = display_cache_node_discussion_teaser
features[variable][] = display_cache_node_discussion_teaser_group
features[variable][] = field_bundle_settings_comment__comment_node_discussion
features[variable][] = field_bundle_settings_node__discussion
features[variable][] = menu_options_discussion
Expand Down
Loading