summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryan_nick2012-08-20 21:33:17 (GMT)
committerTim Plunkett2012-10-22 02:48:35 (GMT)
commitcc7c39bde556e2f9c3f0cd70ce5c86aea7c945b0 (patch)
treee3bfd0feb7b9928c1064f9824592f0e9a8c87fb7
parenta50bddad4941d56602b94eb214d7e818a0ea2493 (diff)
Issue #1741216 by yannickoo: Fixed Views handler doesn't store the field instance in the object, so it's hard to reuse.
-rw-r--r--lib/Views/field/Plugin/views/field/Field.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/Views/field/Plugin/views/field/Field.php b/lib/Views/field/Plugin/views/field/Field.php
index 41f9646..5839be8 100644
--- a/lib/Views/field/Plugin/views/field/Field.php
+++ b/lib/Views/field/Plugin/views/field/Field.php
@@ -24,12 +24,14 @@ class Field extends FieldPluginBase {
/**
* An array to store field renderable arrays for use by render_items.
+ *
* @var array
*/
public $items = array();
/**
* Store the field information.
+ *
* @var array
*/
public $field_info = array();
@@ -37,22 +39,32 @@ class Field extends FieldPluginBase {
/**
* Does the field supports multiple field values.
+ *
* @var bool
*/
public $multiple;
/**
* Does the rendered fields get limited.
+ *
* @var bool
*/
public $limit_values;
/**
* A shortcut for $view->base_table.
+ *
* @var string
*/
public $base_table;
+ /**
+ * Store the field instance.
+ *
+ * @var array
+ */
+ public $instance;
+
function init(&$view, &$options) {
parent::init($view, $options);
@@ -434,10 +446,10 @@ class Field extends FieldPluginBase {
// Provide an instance array for hook_field_formatter_settings_form().
// @todo Remove this: http://drupal.org/node/1741128.
ctools_include('fields');
- $instance = ctools_fields_fake_field_instance($this->definition['field_name'], '_custom', $formatter, $settings);
+ $this->instance = ctools_fields_fake_field_instance($this->definition['field_name'], '_custom', $formatter, $settings);
// Store the settings in a '_custom' view mode.
- $instance['display']['_custom'] = array(
+ $this->instance['display']['_custom'] = array(
'type' => $format,
'settings' => $settings,
);
@@ -446,7 +458,7 @@ class Field extends FieldPluginBase {
$settings_form = array('#value' => array());
$function = $formatter['module'] . '_field_formatter_settings_form';
if (function_exists($function)) {
- $settings_form = $function($field, $instance, '_custom', $form, $form_state);
+ $settings_form = $function($field, $this->instance, '_custom', $form, $form_state);
}
$form['settings'] = $settings_form;
}