summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2012-08-21 21:40:43 +0200
committerwebchick2012-08-21 21:40:43 +0200
commit8546e3833b953b63e40bd53077997a4419798503 (patch)
tree131cee74611032b7561360682cedf8a2e588a8fb
parent64625f9048c4c9e598be232e27c9e65e9c15c189 (diff)
Issue #1245220 by Berdir, plach, David_Rothstein, dpolant, xjm, WorldFallz, bfroehle, effulgentsia, corvus_ch | seddonym: Fixed HEAD BROKEN (and change notification/followup): file_file_download() passed bogus to field_access().
-rw-r--r--core/modules/file/file.api.php12
-rw-r--r--core/modules/file/lib/Drupal/file/Tests/FilePrivateTest.php2
2 files changed, 7 insertions, 7 deletions
diff --git a/core/modules/file/file.api.php b/core/modules/file/file.api.php
index e407b43..71039b1 100644
--- a/core/modules/file/file.api.php
+++ b/core/modules/file/file.api.php
@@ -8,14 +8,14 @@
/**
* Control download access to files.
*
- * The hook is typically implemented to limit access based on the entity the
- * file is referenced, e.g., only users with access to a node should be allowed
- * to download files attached to that node.
+ * The hook is typically implemented to limit access based on the entity that
+ * references the file; for example, only users with access to a node should be
+ * allowed to download files attached to that node.
*
* @param $field
* The field to which the file belongs.
* @param Drupal\entity\EntityInterface $entity
- * The $entity to which $file is referenced.
+ * The entity which references the file.
* @param Drupal\Core\File\File $file
* The file entity that is being requested.
*
@@ -47,8 +47,8 @@ function hook_file_download_access($field, Drupal\entity\EntityInterface $entity
* values are Boolean grant responses for each module.
* @param array $context
* An associative array containing the following key-value pairs:
- * - entity: The entity to which the field item is referenced.
- * - field: The field info of the field the field_item belongs to.
+ * - field: The field to which the file belongs.
+ * - entity: The entity which references the file.
* - file: The file entity that is being requested.
*
* @return
diff --git a/core/modules/file/lib/Drupal/file/Tests/FilePrivateTest.php b/core/modules/file/lib/Drupal/file/Tests/FilePrivateTest.php
index 8bc2940..2febd5f 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FilePrivateTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FilePrivateTest.php
@@ -63,7 +63,7 @@ class FilePrivateTest extends FileFieldTestBase {
// Test with the field that should deny access through field access.
$this->drupalLogin($this->admin_user);
$nid = $this->uploadNodeFile($test_file, $no_access_field_name, $type_name, TRUE, array('private' => TRUE));
- $node = node_load($nid, NULL, TRUE);
+ $node = node_load($nid, TRUE);
$node_file = file_load($node->{$no_access_field_name}[LANGUAGE_NOT_SPECIFIED][0]['fid']);
// Ensure the file cannot be downloaded.
$this->drupalGet(file_create_url($node_file->uri));