-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcck_blocks-833730-24-no-prefix.patch
42 lines (39 loc) · 1.47 KB
/
cck_blocks-833730-24-no-prefix.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
diff --git cck_blocks.module cck_blocks.module
index 03f13f7..1697942 100644
--- cck_blocks.module
+++ cck_blocks.module
@@ -99,22 +99,21 @@ function cck_blocks_block_view($delta = '') {
// build the node in cck_blocks mode if that hasn't been done yet
if (!isset($built_nodes[$nid])) {
- node_build_content($node, 'cck_blocks');
- $built_nodes[$nid] = $node;
- }
- else {
- $node = $built_nodes[$nid];
+ field_attach_prepare_view('node', array($node->nid => $node), 'cck_blocks');
+ entity_prepare_view('node', array($node->nid => $node));
+ $built_nodes[$nid] = field_attach_view('node', $node, 'cck_blocks', $node->language);
}
+
// look directly for the cck_field in the content array
$field_data = false;
- if (isset($node->content[$delta])) {
- $field_data = $node->content[$delta];
+ if (isset($built_nodes[$nid][$delta])) {
+ $field_data = $built_nodes[$nid][$delta];
}
else {
// cycle through all content data arrays looking for cck groups
// the cck_field may be within a group
- foreach ($node->content as $key => $data) {
+ foreach ($built_nodes[$nid] as $key => $data) {
if (is_array($data) && (strpos($key, 'group_') == 0) && isset($data['group'][$delta])) {
$field_data = $data['group'][$delta];
}
@@ -149,6 +148,7 @@ function cck_blocks_block_view($delta = '') {
return $block;
}
+
/**
* Implements hook_form_FORM_ID_alter().
*