summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt4
-rw-r--r--includes/module.inc17
2 files changed, 16 insertions, 5 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 90afde120..ec1d2f91e 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,6 +1,10 @@
Drupal 7.19, xxxx-xx-xx (development version)
-----------------------
+- Fixed entity argument not being passed to implementations of
+ hook_file_download_access_alter(). The fix adds an additional context
+ parameter that can be passed when calling drupal_alter() for any hook (API
+ change: http://drupal.org/node/1882722).
- Fixed broken support for translatable comment fields (API change:
http://drupal.org/node/1874724).
- Added an assertThemeOutput() method to Simpletest to allow tests to check
diff --git a/includes/module.inc b/includes/module.inc
index d932f07b9..341cd7911 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -898,9 +898,10 @@ function drupal_required_modules() {
* hook_TYPE_alter() implementations in modules. It ensures a consistent
* interface for all altering operations.
*
- * A maximum of 2 alterable arguments is supported. In case more arguments need
- * to be passed and alterable, modules provide additional variables assigned by
- * reference in the last $context argument:
+ * A maximum of 2 alterable arguments is supported (a third is supported for
+ * legacy reasons, but should not be used in new code). In case more arguments
+ * need to be passed and alterable, modules provide additional variables
+ * assigned by reference in the last $context argument:
* @code
* $context = array(
* 'alterable' => &$alterable,
@@ -939,8 +940,14 @@ function drupal_required_modules() {
* (optional) An additional variable that is passed by reference. If more
* context needs to be provided to implementations, then this should be an
* associative array as described above.
+ * @param $context3
+ * (optional) An additional variable that is passed by reference. This
+ * parameter is deprecated and will not exist in Drupal 8; consequently, it
+ * should not be used for new Drupal 7 code either. It is here only for
+ * backwards compatibility with older code that passed additional arguments
+ * to drupal_alter().
*/
-function drupal_alter($type, &$data, &$context1 = NULL, &$context2 = NULL) {
+function drupal_alter($type, &$data, &$context1 = NULL, &$context2 = NULL, &$context3 = NULL) {
// Use the advanced drupal_static() pattern, since this is called very often.
static $drupal_static_fast;
if (!isset($drupal_static_fast)) {
@@ -1053,6 +1060,6 @@ function drupal_alter($type, &$data, &$context1 = NULL, &$context2 = NULL) {
}
foreach ($functions[$cid] as $function) {
- $function($data, $context1, $context2);
+ $function($data, $context1, $context2, $context3);
}
}