diff -u b/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php --- b/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php +++ b/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php @@ -838,11 +838,13 @@ /** * Determine if the display's style uses fields. + * + * @return bool */ - function uses_fields() { - $plugin = $this->get_plugin(); + function usesFields() { + $plugin = $this->get_plugin('style'); if ($plugin) { - return $plugin->uses_fields(); + return $plugin->usesFields(); } } @@ -1213,7 +1215,7 @@ $options['style_plugin']['links']['style_options'] = t('Change settings for this format'); } - if ($style_plugin_instance->uses_row_plugin()) { + if ($style_plugin_instance->usesRowPlugin()) { $manager = new ViewsPluginManager('row'); $row_plugin = $manager->getDefinition($this->get_option('row_plugin')); $row_plugin_instance = $this->get_plugin('row'); @@ -1942,7 +1944,7 @@ } } - if ($plugin->uses_row_plugin()) { + if ($plugin->usesRowPlugin()) { $row_plugin = $this->get_plugin('row'); if ($row_plugin) { $funcs[] = $this->option_link(t('Row style output'), 'analyze-theme-row') . ': ' . $this->format_themes($row_plugin->theme_functions()); @@ -1955,7 +1957,7 @@ } } - if ($plugin->uses_fields()) { + if ($plugin->usesFields()) { foreach ($this->get_handlers('field') as $id => $handler) { $funcs[] = $this->option_link(t('Field @field (ID: @id)', array('@field' => $handler->ui_name(), '@id' => $id)), 'analyze-theme-field') . ': ' . $this->format_themes($handler->theme_functions()); } @@ -2724,7 +2726,7 @@ function validate() { $errors = array(); // Make sure displays that use fields HAVE fields. - if ($this->uses_fields()) { + if ($this->usesFields()) { $fields = FALSE; foreach ($this->get_handlers('field') as $field) { if (empty($field->options['exclude'])) { @@ -2941,7 +2943,7 @@ $plugin = $style_plugin; } else { - if (!$style_plugin || !$style_plugin->uses_row_plugin()) { + if (!$style_plugin || !$style_plugin->usesRowPlugin()) { return; } @@ -3002,7 +3004,7 @@ $plugin = $style_plugin; } else { - if (!$style_plugin || !$style_plugin->uses_row_plugin()) { + if (!$style_plugin || !$style_plugin->usesRowPlugin()) { return; } diff -u b/lib/Drupal/views/Plugin/views/row/Fields.php b/lib/Drupal/views/Plugin/views/row/Fields.php --- b/lib/Drupal/views/Plugin/views/row/Fields.php +++ b/lib/Drupal/views/Plugin/views/row/Fields.php @@ -35,7 +35,7 @@ * * @var bool */ - public $uses_fields = TRUE; + public $usesFields = TRUE; function option_definition() { $options = parent::option_definition(); diff -u b/lib/Drupal/views/Plugin/views/row/RowPluginBase.php b/lib/Drupal/views/Plugin/views/row/RowPluginBase.php --- b/lib/Drupal/views/Plugin/views/row/RowPluginBase.php +++ b/lib/Drupal/views/Plugin/views/row/RowPluginBase.php @@ -31,7 +31,7 @@ * * @var bool */ - public $uses_fields = FALSE; + public $usesFields = FALSE; /** * Initialize the row plugin. @@ -44,8 +44,13 @@ $this->unpack_options($this->options, isset($options) ? $options : $display->handler->get_option('row_options')); } - function uses_fields() { - return $this->uses_fields; + /** + * Returns the usesFields property. + * + * @return bool + */ + function usesFields() { + return $this->usesFields; } diff -u b/lib/Drupal/views/Plugin/views/row/RssFields.php b/lib/Drupal/views/Plugin/views/row/RssFields.php --- b/lib/Drupal/views/Plugin/views/row/RssFields.php +++ b/lib/Drupal/views/Plugin/views/row/RssFields.php @@ -30,7 +30,7 @@ * * @var bool */ - public $uses_fields = TRUE; + public $usesFields = TRUE; function option_definition() { $options = parent::option_definition(); diff -u b/lib/Drupal/views/Plugin/views/style/DefaultStyle.php b/lib/Drupal/views/Plugin/views/style/DefaultStyle.php --- b/lib/Drupal/views/Plugin/views/style/DefaultStyle.php +++ b/lib/Drupal/views/Plugin/views/style/DefaultStyle.php @@ -34,14 +34,14 @@ * * @var bool */ - public $uses_row_plugin = TRUE; + public $usesRowPlugin = TRUE; /** * Does the style plugin support custom css class for the rows. * * @var bool */ - public $uses_row_class = TRUE; + public $usesRowClass = TRUE; /** * Set default options diff -u b/lib/Drupal/views/Plugin/views/style/Grid.php b/lib/Drupal/views/Plugin/views/style/Grid.php --- b/lib/Drupal/views/Plugin/views/style/Grid.php +++ b/lib/Drupal/views/Plugin/views/style/Grid.php @@ -32,14 +32,14 @@ * * @var bool */ - public $uses_row_plugin = TRUE; + public $usesRowPlugin = TRUE; /** * Does the style plugin support custom css class for the rows. * * @var bool */ - public $uses_row_class = TRUE; + public $usesRowClass = TRUE; /** * Set default options diff -u b/lib/Drupal/views/Plugin/views/style/HtmlList.php b/lib/Drupal/views/Plugin/views/style/HtmlList.php --- b/lib/Drupal/views/Plugin/views/style/HtmlList.php +++ b/lib/Drupal/views/Plugin/views/style/HtmlList.php @@ -32,14 +32,14 @@ * * @var bool */ - public $uses_row_plugin = TRUE; + public $usesRowPlugin = TRUE; /** * Does the style plugin support custom css class for the rows. * * @var bool */ - public $uses_row_class = TRUE; + public $usesRowClass = TRUE; /** * Set default options diff -u b/lib/Drupal/views/Plugin/views/style/Rss.php b/lib/Drupal/views/Plugin/views/style/Rss.php --- b/lib/Drupal/views/Plugin/views/style/Rss.php +++ b/lib/Drupal/views/Plugin/views/style/Rss.php @@ -32,7 +32,7 @@ * * @var bool */ - public $uses_row_plugin = TRUE; + public $usesRowPlugin = TRUE; function attach_to($display_id, $path, $title) { $display = $this->view->display[$display_id]->handler; @@ -111,7 +111,7 @@ function render() { if (empty($this->row_plugin)) { - vpr('views_plugin_style_default: Missing row plugin'); + vpr('Drupal\views\Plugin\views\style\Rss: Missing row plugin'); return; } $rows = ''; diff -u b/lib/Drupal/views/Plugin/views/style/StylePluginBase.php b/lib/Drupal/views/Plugin/views/style/StylePluginBase.php --- b/lib/Drupal/views/Plugin/views/style/StylePluginBase.php +++ b/lib/Drupal/views/Plugin/views/style/StylePluginBase.php @@ -48,14 +48,14 @@ * * @var bool */ - public $uses_row_plugin = FALSE; + public $usesRowPlugin = FALSE; /** * Does the style plugin support custom css class for the rows. * * @var bool */ - public $uses_row_class = FALSE; + public $usesRowClass = FALSE; /** * Does the style plugin for itself support to add fields to it's output. @@ -65,7 +65,7 @@ * * @var bool */ - public $uses_fields = FALSE; + public $usesFields = FALSE; /** * Initialize a style plugin. @@ -83,7 +83,7 @@ // Overlay incoming options on top of defaults $this->unpack_options($this->options, isset($options) ? $options : $display->handler->get_option('style_options')); - if ($this->uses_row_plugin() && $display->handler->get_option('row_plugin')) { + if ($this->usesRowPlugin() && $display->handler->get_option('row_plugin')) { $this->row_plugin = $display->handler->get_plugin('row'); } @@ -105,22 +105,22 @@ } /** - * Return TRUE if this style also uses a row plugin. + * Returns the usesRowPlugin property. * * @return bool */ - function uses_row_plugin() { - return $this->uses_row_plugin; + function usesRowPlugin() { + return $this->usesRowPlugin; } /** - * Return TRUE if this style also uses a row plugin. + * Returns the usesRowClass property. * * @return bool */ - function uses_row_class() { - return $this->uses_row_class; + function usesRowClass() { + return $this->usesRowClass; } /** @@ -128,15 +128,15 @@ * * @return bool */ - function uses_fields() { + function usesFields() { // If we use a row plugin, ask the row plugin. Chances are, we don't // care, it does. $row_uses_fields = FALSE; - if ($this->uses_row_plugin() && !empty($this->row_plugin)) { - $row_uses_fields = $this->row_plugin->uses_fields(); + if ($this->usesRowPlugin() && !empty($this->row_plugin)) { + $row_uses_fields = $this->row_plugin->usesFields(); } // Otherwise, check the definition or the option. - return $row_uses_fields || $this->uses_fields || !empty($this->options['uses_fields']); + return $row_uses_fields || $this->usesFields || !empty($this->options['uses_fields']); } /** @@ -145,7 +145,7 @@ * Used to ensure we don't fetch tokens when not needed for performance. */ function uses_tokens() { - if ($this->uses_row_class()) { + if ($this->usesRowClass()) { $class = $this->options['row_class']; if (strpos($class, '[') !== FALSE || strpos($class, '!') !== FALSE || strpos($class, '%') !== FALSE) { return TRUE; @@ -157,9 +157,9 @@ * Return the token replaced row class for the specified row. */ function get_row_class($row_index) { - if ($this->uses_row_class()) { + if ($this->usesRowClass()) { $class = $this->options['row_class']; - if ($this->uses_fields() && $this->view->field) { + if ($this->usesFields() && $this->view->field) { $class = strip_tags($this->tokenize_value($class, $row_index)); } @@ -205,7 +205,7 @@ function option_definition() { $options = parent::option_definition(); $options['grouping'] = array('default' => array()); - if ($this->uses_row_class()) { + if ($this->usesRowClass()) { $options['row_class'] = array('default' => ''); $options['default_row_class'] = array('default' => TRUE, 'bool' => TRUE); $options['row_class_special'] = array('default' => TRUE, 'bool' => TRUE); @@ -221,7 +221,7 @@ // themselves from being groupable by setting their "use grouping" definiton // key to FALSE. // @TODO: Document "uses grouping" in docs.php when docs.php is written. - if ($this->uses_fields() && $this->definition['uses_grouping']) { + if ($this->usesFields() && $this->definition['uses_grouping']) { $options = array('' => t('- None -')); $field_labels = $this->display->handler->get_field_labels(TRUE); $options += $field_labels; @@ -275,7 +275,7 @@ } } - if ($this->uses_row_class()) { + if ($this->usesRowClass()) { $form['row_class'] = array( '#title' => t('Row class'), '#description' => t('The class to provide on each row.'), @@ -283,7 +283,7 @@ '#default_value' => $this->options['row_class'], ); - if ($this->uses_fields()) { + if ($this->usesFields()) { $form['row_class']['#description'] .= ' ' . t('You may use field tokens from as per the "Replacement patterns" used in "Rewrite the output of this field" for all fields.'); } @@ -301,7 +301,7 @@ ); } - if (!$this->uses_fields() || !empty($this->options['uses_fields'])) { + if (!$this->usesFields() || !empty($this->options['uses_fields'])) { $form['uses_fields'] = array( '#type' => 'checkbox', '#title' => t('Force using fields'), @@ -352,8 +352,8 @@ * Render the display in this style. */ function render() { - if ($this->uses_row_plugin() && empty($this->row_plugin)) { - debug('views_plugin_style_default: Missing row plugin'); + if ($this->usesRowPlugin() && empty($this->row_plugin)) { + vpr('Drupal\views\Plugin\views\style\StylePluginBase: Missing row plugin'); return; } @@ -398,7 +398,7 @@ } // Render as a record set. else { - if ($this->uses_row_plugin()) { + if ($this->usesRowPlugin()) { foreach ($set['rows'] as $index => $row) { $this->view->row_index = $index; $set['rows'][$index] = $this->row_plugin->render($row); @@ -547,7 +547,7 @@ * The result array from $view->result */ function render_fields($result) { - if (!$this->uses_fields()) { + if (!$this->usesFields()) { return; } @@ -610,7 +610,7 @@ function validate() { $errors = parent::validate(); - if ($this->uses_row_plugin()) { + if ($this->usesRowPlugin()) { $plugin = $this->display->handler->get_plugin('row'); if (empty($plugin)) { $errors[] = t('Style @style requires a row style but the row plugin is invalid.', array('@style' => $this->definition['title'])); diff -u b/lib/Drupal/views/Plugin/views/style/Table.php b/lib/Drupal/views/Plugin/views/style/Table.php --- b/lib/Drupal/views/Plugin/views/style/Table.php +++ b/lib/Drupal/views/Plugin/views/style/Table.php @@ -32,21 +32,21 @@ * * @var bool */ - public $uses_fields = TRUE; + public $usesFields = TRUE; /** * Does the style plugin allows to use style plugins. * * @var bool */ - public $uses_row_plugin = FALSE; + public $usesRowPlugin = FALSE; /** * Does the style plugin support custom css class for the rows. * * @var bool */ - public $uses_row_class = TRUE; + public $usesRowClass = TRUE; /** * Contains the current active sort column. only in patch2: unchanged: --- a/includes/admin.inc +++ b/includes/admin.inc @@ -2053,7 +2053,7 @@ function views_ui_import_validate($form, &$form_state) { drupal_set_message(t('Style plugin @plugin is not available.', array('@plugin' => $display->handler->get_option('style_plugin'))), 'error'); $broken = TRUE; } - elseif ($plugin->uses_row_plugin()) { + elseif ($plugin->usesRowPlugin()) { $plugin = views_get_plugin('row', $display->handler->get_option('row_plugin')); if (!$plugin) { drupal_set_message(t('Row plugin @plugin is not available.', array('@plugin' => $display->handler->get_option('row_plugin'))), 'error'); @@ -2209,7 +2209,7 @@ function views_ui_edit_form_get_bucket($type, $view, $display) { case 'field': // Fetch the style plugin info so we know whether to list fields or not. $style_plugin = $display->handler->get_plugin(); - $uses_fields = $style_plugin && $style_plugin->uses_fields(); + $uses_fields = $style_plugin && $style_plugin->usesFields(); if (!$uses_fields) { $build['fields'][] = array( '#markup' => t('The selected style or row format does not utilize fields.'), only in patch2: unchanged: --- a/lib/Drupal/views/Plugin/views/filter/Combine.php +++ b/lib/Drupal/views/Plugin/views/filter/Combine.php @@ -37,7 +37,7 @@ class Combine extends String { $this->view->init_style(); // Allow to choose all fields as possible - if ($this->view->style_plugin->uses_fields()) { + if ($this->view->style_plugin->usesFields()) { $options = array(); foreach ($this->view->display_handler->get_handlers('field') as $name => $field) { $options[$name] = $field->ui_name(TRUE); only in patch2: unchanged: --- a/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php +++ b/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php @@ -278,7 +278,7 @@ abstract class WizardPluginBase implements WizardInterface { // @fixme $style_plugin = views_get_plugin('style', $style); - if (isset($style_plugin) && $style_plugin->uses_row_plugin()) { + if (isset($style_plugin) && $style_plugin->usesRowPlugin()) { $options = $this->row_style_options($type); $style_form['row_plugin'] = array( '#type' => 'select', @@ -300,7 +300,7 @@ abstract class WizardPluginBase implements WizardInterface { '#theme_wrappers' => array('container'), ); } - elseif ($style_plugin->uses_fields()) { + elseif ($style_plugin->usesFields()) { $style_form['row_plugin'] = array('#markup' => '' . t('of fields') . ''); } } only in patch2: unchanged: --- a/lib/Drupal/views/View.php +++ b/lib/Drupal/views/View.php @@ -1019,7 +1019,7 @@ class View extends ViewsDbObject { return FALSE; } - if ($this->style_plugin->uses_fields()) { + if ($this->style_plugin->usesFields()) { $this->_build('field'); } @@ -1245,7 +1245,7 @@ class View extends ViewsDbObject { // Give field handlers the opportunity to perform additional queries // using the entire resultset prior to rendering. - if ($this->style_plugin->uses_fields()) { + if ($this->style_plugin->usesFields()) { foreach ($this->field as $id => $handler) { if (!empty($this->field[$id])) { $this->field[$id]->pre_render($this->result);