Skip to content
Snippets Groups Projects
Commit 4afa676d authored by Marc van Gend's avatar Marc van Gend
Browse files

prevent warning when no fieldblocks are set

parent 6fbc6838
No related branches found
No related tags found
No related merge requests found
......@@ -72,15 +72,17 @@ function fieldblock_block_info() {
$blocks = array();
$fieldblocks = fieldblock_get_block_list();
foreach ($fieldblocks as $fieldblock_id => $fieldblock) {
$blocks[$fieldblock_id] = array(
'info' => t('@field (field in @type: @bundle)', array(
'@field' => $fieldblock['field_label'],
'@type' => $fieldblock['type'],
'@bundle' => $fieldblock['bundle_label'],
)),
'cache' => DRUPAL_CACHE_PER_PAGE,
);
if ($fieldblocks) {
foreach ($fieldblocks as $fieldblock_id => $fieldblock) {
$blocks[$fieldblock_id] = array(
'info' => t('@field (field in @type: @bundle)', array(
'@field' => $fieldblock['field_label'],
'@type' => $fieldblock['type'],
'@bundle' => $fieldblock['bundle_label'],
)),
'cache' => DRUPAL_CACHE_PER_PAGE,
);
}
}
return $blocks;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment