summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-05-18 00:07:38 -0500
committerwebchick <webchick@24967.no-reply.drupal.org>2011-05-18 00:07:38 -0500
commit75a0deb2722bde4fc7d60d02f186809fbc77320d (patch)
tree32f7f65f2a30a4970550f93e45f79c2b4c3bd589 /includes
parent8c3dbb5e7f0a997662350ca44efa271514e83047 (diff)
downloadbrdo-75a0deb2722bde4fc7d60d02f186809fbc77320d.tar.gz
brdo-75a0deb2722bde4fc7d60d02f186809fbc77320d.tar.bz2
Issue #1089174 by plach: Fixed Prepare view hooks do not receive the language parameter.
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc11
1 files changed, 9 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 4168ec9a2..cb851d4b9 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -7496,8 +7496,15 @@ function entity_get_controller($entity_type) {
* The type of entity, i.e. 'node', 'user'.
* @param $entities
* The entity objects which are being prepared for view, keyed by object ID.
+ * @param $langcode
+ * (optional) A language code to be used for rendering. Defaults to the global
+ * content language of the current request.
*/
-function entity_prepare_view($entity_type, $entities) {
+function entity_prepare_view($entity_type, $entities, $langcode = NULL) {
+ if (!isset($langcode)) {
+ $langcode = $GLOBALS['language_content']->language;
+ }
+
// To ensure hooks are only run once per entity, check for an
// entity_view_prepared flag and only process items without it.
// @todo: resolve this more generally for both entity and field level hooks.
@@ -7513,7 +7520,7 @@ function entity_prepare_view($entity_type, $entities) {
}
if (!empty($prepare)) {
- module_invoke_all('entity_prepare_view', $prepare, $entity_type);
+ module_invoke_all('entity_prepare_view', $prepare, $entity_type, $langcode);
}
}