Skip to content

Commit

Permalink
Update File Entity to 7.x-2.37
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Hunt committed Feb 11, 2023
1 parent 01e08d0 commit 909d313
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,13 @@ function file_entity_field_formatter_view($entity_type, $entity, $field, $instan

switch ($display['type']) {
case 'file_rendered':
// A file entity page view (/file/[fid]) may not have a value on the $field['field_name'] key
// @see https://www.drupal.org/project/file_entity/issues/3175010
$has_referencing_field = isset($field['field_name']) ? TRUE : FALSE;
foreach ($items as $delta => $item) {
if (!empty($item)) {
// The repeat-rendering protection may be disabled if necessary.
if (variable_get('file_entity_protect_repeated_render', TRUE)) {
if (variable_get('file_entity_protect_repeated_render', TRUE) && $has_referencing_field) {
// Protect ourselves from repeated rendering.
static $repeated_render_depth = array();
list($entity_id) = entity_extract_ids($entity_type, $entity);
Expand Down Expand Up @@ -396,7 +399,7 @@ function file_entity_field_formatter_view($entity_type, $entity, $field, $instan
// @see https://www.drupal.org/node/2333107
$file->referencing_entity = $entity;
$file->referencing_entity_type = $entity_type;
$file->referencing_field = $field['field_name'];
$file->referencing_field = $has_referencing_field ? $field['field_name'] : '';

// Prevent recursion by checking if the referencing entity is itself
// do not display it again (return an empty array).
Expand Down Expand Up @@ -424,6 +427,7 @@ function file_entity_field_formatter_view($entity_type, $entity, $field, $instan
);
}
}

break;

case 'file_download_link':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ configure = admin/config/media/file-settings
; We have to add a fake version so Git checkouts do not fail Media dependencies
version = 7.x-2.x-dev

; Information added by Drupal.org packaging script on 2022-03-19
version = "7.x-2.36"
; Information added by Drupal.org packaging script on 2023-01-12
version = "7.x-2.37"
core = "7.x"
project = "file_entity"
datestamp = "1647724729"
datestamp = "1673539889"
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,12 @@ class FileEntityUploadWizardTestCase extends FileEntityTestHelper {
* Test file administration page functionality.
*/
class FileEntityAdminTestCase extends FileEntityTestHelper {
protected $admin_user = NULL;
protected $base_user_1 = NULL;
protected $base_user_2 = NULL;
protected $base_user_3 = NULL;
protected $base_user_4 = NULL;

public static function getInfo() {
return array(
'name' => 'File administration',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ core = 7.x
dependencies[] = file_entity
hidden = TRUE

; Information added by Drupal.org packaging script on 2022-03-19
version = "7.x-2.36"
; Information added by Drupal.org packaging script on 2023-01-12
version = "7.x-2.37"
core = "7.x"
project = "file_entity"
datestamp = "1647724729"
datestamp = "1673539889"

0 comments on commit 909d313

Please sign in to comment.