Drupal 7 – Legal module error – Undefined variable: options in views_handler_field_locale_language->render()

If you meet the following error when viewing the T&C History of the Legal module.
Notice: Undefined variable: options in views_handler_field_locale_language->render()…

The following patch on Views might help.

diff --git a/modules/locale/views_handler_field_locale_language.inc b/modules/locale/views_handler_field_locale_language.inc
index 68a4eb4..8038e2b 100644
--- a/modules/locale/views_handler_field_locale_language.inc
+++ b/modules/locale/views_handler_field_locale_language.inc
@@ -29,8 +29,8 @@ class views_handler_field_locale_language extends views_handler_field {
   }
 
   function render($values) {
-    $languages = locale_language_list(empty($this->$options['native_language']) ? 'name' : 'native');
+    $languages = locale_language_list(empty($this->options['native_language']) ? 'name' : 'native');
     $value = $this->get_value($values);
-    return isset($languages[$value]) ? $languages[$value]->name : '';
+    return isset($languages[$value]) ? $languages[$value] : '';
   }
 }

 

Done =)

Reference: Views Handler field_locale_language

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s