Commit f8bfbc4d authored by marcvangend's avatar marcvangend

cleanup: remove unused static cache

parent 64bfe89b
......@@ -41,30 +41,26 @@ class FieldBlock extends DeriverBase {
* An array of fieldblocks in the form of fieldblock_id => admin label.
*/
protected function fieldBlockGetBlockList() {
// @todo Check if we actually need static caching.
$fieldblocks = &drupal_static(__FUNCTION__);
$fieldblocks = array();
if (!isset($fieldblocks)) {
$fieldblocks = array();
// Get all EntityViewDisplay config entities and iterate over them.
$entity_view_displays = EntityViewDisplay::loadMultiple();
// Get all EntityViewDisplay config entities and iterate over them.
$entity_view_displays = EntityViewDisplay::loadMultiple();
/** @var \Drupal\Core\Entity\EntityDisplayModeInterface $entity_view_display */
foreach ($entity_view_displays as $display_id => $entity_view_display) {
$view_display_fieldblocks = $entity_view_display->getThirdPartySettings('fieldblock');
$entity_type = $entity_view_display->get('targetEntityType');
$bundle = $entity_view_display->get('bundle');
$mode = $entity_view_display->get('mode');
/** @var \Drupal\Core\Entity\EntityDisplayModeInterface $entity_view_display */
foreach ($entity_view_displays as $display_id => $entity_view_display) {
$view_display_fieldblocks = $entity_view_display->getThirdPartySettings('fieldblock');
$entity_type = $entity_view_display->get('targetEntityType');
$bundle = $entity_view_display->get('bundle');
$mode = $entity_view_display->get('mode');
foreach ($view_display_fieldblocks as $field_name => $field_label) {
$fieldblock_id = $display_id . ':' . $field_name;
$fieldblocks[$fieldblock_id] = t('@field field (from @type: @bundle: @mode)', array(
'@field' => $field_label,
'@type' => $entity_type,
'@bundle' => $bundle,
'@mode' => $mode,
));
}
foreach ($view_display_fieldblocks as $field_name => $field_label) {
$fieldblock_id = $display_id . ':' . $field_name;
$fieldblocks[$fieldblock_id] = t('@field field (from @type: @bundle: @mode)', array(
'@field' => $field_label,
'@type' => $entity_type,
'@bundle' => $bundle,
'@mode' => $mode,
));
}
}
......
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