Skip to content

Commit

Permalink
Update Views to 7.x-3.29
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Hunt committed Mar 16, 2023
1 parent fcacc80 commit 1072f10
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,8 @@ class views_handler_area_result extends views_handler_area {
) {
$format = $this->options['format_plural_plural'];
}
// If there is an item count,
if (
!empty($total)
// or there is content in the empty area,
|| !empty($this->options['empty'])
// and a query has been performed:
&& !empty($this->view->build_info['count_query'])
) {
// If there is an item count or there is content in the empty area.
if (!empty($total) || !empty($this->options['empty'])) {
// Adds the result to the output.
// We don't want to sanitize with filter_xss_admin() here because Views
// administrators are trusted users and should be allowed to insert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,15 @@ function list_filter($form_state, $view) {
}
else {
// Check whether the tag can be found in the views tag.
return strpos($view->tag, $form_state['values']['tag']) === FALSE;
$tag = '';
if (isset($view->tag)) {
$tag = $view->tag;
}
$form_state_tag = '';
if (isset($form_state['values']['tag'])) {
$form_state_tag = $form_state['values']['tag'];
}
return strpos($tag, $form_state_tag) === FALSE;
}
}
if ($form_state['values']['base'] != 'all' && $form_state['values']['base'] != $view->base_table) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,15 @@ class views_plugin_display_page extends views_plugin_display {
parent::options_validate($form, $form_state);
switch ($form_state['section']) {
case 'path':
if (strpos($form_state['values']['path'], '$arg') !== FALSE) {
$skip = FALSE;
if (!isset($form_state['values']['path'])) {
$skip = TRUE;
}
if (!$skip && strpos($form_state['values']['path'], '$arg') !== FALSE) {
form_error($form['path'], t('"$arg" is no longer supported. Use % instead.'));
}

if (strpos($form_state['values']['path'], '%') === 0) {
if (!$skip && strpos($form_state['values']['path'], '%') === 0) {
form_error($form['path'], t('"%" may not be used for the first segment of a path.'));
}

Expand All @@ -539,8 +543,12 @@ class views_plugin_display_page extends views_plugin_display {
break;

case 'menu':
$skip = FALSE;
$path = $this->get_option('path');
if ($form_state['values']['menu']['type'] == 'normal' && strpos($path, '%') !== FALSE) {
if (!isset($path)) {
$skip = TRUE;
}
if (!$skip && $form_state['values']['menu']['type'] == 'normal' && strpos($path, '%') !== FALSE) {
form_error($form['menu']['type'], t('Views cannot create normal menu items for paths with a % in them.'));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ class views_plugin_pager_full extends views_plugin_pager {
public function options_validate(&$form, &$form_state) {
// Only accept integer values.
$error = FALSE;
$exposed_options = $form_state['values']['pager_options']['expose']['items_per_page_options'];
$exposed_options = '';
if (isset($form_state['values']['pager_options']['expose']['items_per_page_options'])) {
$exposed_options = $form_state['values']['pager_options']['expose']['items_per_page_options'];
}
if (strpos($exposed_options, '.') !== FALSE) {
$error = TRUE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ class views_plugin_style extends views_plugin {
*/
public function uses_tokens() {
if ($this->uses_row_class()) {
$class = $this->options['row_class'];
$class = '';
if (isset($this->options['row_class'])) {
$class = $this->options['row_class'];
}
if (strpos($class, '[') !== FALSE || strpos($class, '!') !== FALSE || strpos($class, '%') !== FALSE) {
return TRUE;
}
Expand Down Expand Up @@ -152,6 +155,9 @@ class views_plugin_style extends views_plugin {
* Take a value and apply token replacement logic to it.
*/
public function tokenize_value($value, $row_index) {
if (!isset($value)) {
$value = '';
}
if (strpos($value, '[') !== FALSE || strpos($value, '!') !== FALSE || strpos($value, '%') !== FALSE) {
$fake_item = array(
'alter_text' => TRUE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,9 @@ protected function default_display_filters_user($form, $form_state) {
}
else {
foreach ($fields as $field_name => $value) {
if (!isset($field_name)) {
$field_name = '';
}
if ($pos = strpos($field_name, '.' . $bundle_key)) {
$table = substr($field_name, 0, $pos);
break;
Expand Down
6 changes: 3 additions & 3 deletions docroot/sites/all/modules/contrib/views/tests/views_test.info
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ core = 7.x
dependencies[] = views
hidden = TRUE

; Information added by Drupal.org packaging script on 2022-12-19
version = "7.x-3.28"
; Information added by Drupal.org packaging script on 2023-03-13
version = "7.x-3.29"
core = "7.x"
project = "views"
datestamp = "1671451989"
datestamp = "1678722019"
6 changes: 3 additions & 3 deletions docroot/sites/all/modules/contrib/views/views.info
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ files[] = tests/views_clone.test
files[] = tests/views_view.test
files[] = tests/views_ui.test

; Information added by Drupal.org packaging script on 2022-12-19
version = "7.x-3.28"
; Information added by Drupal.org packaging script on 2023-03-13
version = "7.x-3.29"
core = "7.x"
project = "views"
datestamp = "1671451989"
datestamp = "1678722019"
6 changes: 3 additions & 3 deletions docroot/sites/all/modules/contrib/views/views_ui.info
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ dependencies[] = views
files[] = views_ui.module
files[] = plugins/views_wizard/views_ui_base_views_wizard.class.php

; Information added by Drupal.org packaging script on 2022-12-19
version = "7.x-3.28"
; Information added by Drupal.org packaging script on 2023-03-13
version = "7.x-3.29"
core = "7.x"
project = "views"
datestamp = "1671451989"
datestamp = "1678722019"
4 changes: 3 additions & 1 deletion docroot/sites/all/modules/contrib/views/views_ui.module
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,9 @@ function _views_ui_get_paths($view) {
foreach ($view->display as $display) {
if (!empty($display->handler) && $display->handler->has_path()) {
$one_path = $display->handler->get_option('path');

if (!isset($one_path)) {
$one_path = '';
}
if (empty($view->disabled) && strpos($one_path, '%') === FALSE) {
// @codingStandardsIgnoreLine
$all_paths[] = l('/' . $one_path, $one_path);
Expand Down

0 comments on commit 1072f10

Please sign in to comment.