summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Haug2009-03-23 16:10:37 (GMT)
committer Nathan Haug2009-03-23 16:10:37 (GMT)
commit37011622377ff729c88917e76d09f98882f64ba8 (patch)
treee8723ea6e2dad9a86b06ba15971afb2761f3b411
parent6231ddf9ec4859c36afb39824fbaa516e400108d (diff)
#299329: Alt and Title display "a" in Views.
-rw-r--r--filefield_field.inc12
1 files changed, 12 insertions, 0 deletions
diff --git a/filefield_field.inc b/filefield_field.inc
index 4ae9e40..bf07dc9 100644
--- a/filefield_field.inc
+++ b/filefield_field.inc
@@ -183,6 +183,18 @@ function filefield_field_sanitize($node, $field, &$items, $teaser, $page) {
// Add nid so formatters can create a link to the node.
$items[$delta]['nid'] = $node->nid;
+ // TODO: This is only necessary for Views, which doesn't call the "load"
+ // $op. It might be preferable to move this to Views integration somehow.
+ if (!empty($items['data']) && is_string($items[$delta]['data'])) {
+ $item['data'] = unserialize($item['data']);
+ }
+ // Temporary fix to unserialize data serialized multiple times.
+ // See the FileField issue http://drupal.org/node/402860.
+ // And the CCK issue http://drupal.org/node/407446.
+ while (!empty($items[$delta]['data']) && is_string($items[$delta]['data'])) {
+ $items[$delta]['data'] = unserialize($items[$delta]['data']);
+ }
+
// Verify the file exists on the server.
if (!empty($item['filepath']) && !file_exists($item['filepath'])) {
watchdog('filefield', 'FileField was trying to display the file %file, but it does not exist.', array('%file' => $item['filepath']));