Révision 02a0babc
Ajouté par Assos Assos il y a presque 7 ans
drupal7/sites/all/modules/file_entity/file_entity.field.inc | ||
---|---|---|
272 | 272 |
return implode('<br />', $summary); |
273 | 273 |
} |
274 | 274 |
|
275 |
/** |
|
276 |
* Implements hook_field_formatter_prepare_view(). |
|
277 |
*/ |
|
278 |
function file_entity_field_formatter_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $displays) { |
|
279 |
// File and image fields set item values to NULL if a file cannot be loaded. |
|
280 |
// Remove those empty items so we can simply iterate through $items normally |
|
281 |
// in file_entity_field_formatter_view(). |
|
282 |
foreach (array_keys($entities) as $id) { |
|
283 |
$items[$id] = array_filter($items[$id]); |
|
284 |
} |
|
285 |
} |
|
286 |
|
|
275 | 287 |
/** |
276 | 288 |
* Implements hook_field_formatter_view(). |
277 | 289 |
*/ |
... | ... | |
356 | 368 |
case 'file_audio': |
357 | 369 |
$multiple_file_behavior = $settings['multiple_file_behavior']; |
358 | 370 |
|
359 |
// Prevent 'empty' fields from causing a WSOD. |
|
360 |
$items = array_filter($items); |
|
361 |
|
|
362 | 371 |
// Build an array of sources for each <audio> element. |
363 | 372 |
$source_lists = array(); |
364 | 373 |
if ($multiple_file_behavior == 'tags') { |
... | ... | |
392 | 401 |
case 'file_video': |
393 | 402 |
$multiple_file_behavior = $settings['multiple_file_behavior']; |
394 | 403 |
|
395 |
// Prevent 'empty' fields from causing a WSOD. |
|
396 |
$items = array_filter($items); |
|
397 |
|
|
398 | 404 |
// Build an array of sources for each <video> element. |
399 | 405 |
$source_lists = array(); |
400 | 406 |
if ($multiple_file_behavior == 'tags') { |
Formats disponibles : Unified diff
Weekly update of contrib modules