Skip to content

Commit

Permalink
SHS-5643 rethink the purpose of alt text listing (#1560)
Browse files Browse the repository at this point in the history
* chore(SHS-5643): enable Views options so that we can see (and debug) its queries

* fix(SHS-5643): misc bugs with alt text listing

* fix(SHS-5643): fixed fatal PHP errors when looking at the default view display

* fix(shsh-5643): update image alt text view filter labels

---------

Co-authored-by: Andrés Díaz Soto <andres.diaz.soto@gmail.com>
  • Loading branch information
dalin- and cienvaras authored Jun 29, 2024
1 parent 1c4dab0 commit b4702c4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
10 changes: 5 additions & 5 deletions config/default/views.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ ui:
show:
additional_queries: false
advanced_column: true
default_display: false
performance_statistics: false
default_display: true
performance_statistics: true
preview_information: true
sql_query:
enabled: false
enabled: true
where: above
display_embed: false
always_live_preview: false
display_embed: true
always_live_preview: true
exposed_filter_any_label: old_any
field_rewrite_elements:
div: DIV
Expand Down
22 changes: 7 additions & 15 deletions config/default/views.view.new_default_image_alt_text.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
- user
- views_bulk_operations
id: new_default_image_alt_text
label: 'New Default Image Alt Text'
label: 'Default Image Alt Text'
module: views
description: ''
tag: ''
Expand Down Expand Up @@ -272,7 +272,7 @@ display:
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: target_id
click_sort_column: alt
type: image
settings:
image_link: ''
Expand Down Expand Up @@ -503,7 +503,7 @@ display:
access:
type: perm
options:
perm: 'view media'
perm: 'edit any image media'
cache:
type: tag
options: { }
Expand Down Expand Up @@ -646,7 +646,7 @@ display:
placeholder: null
is_grouped: true
group_info:
label: 'Alternative Text'
label: 'Alt Text'
description: ''
identifier: alt
optional: true
Expand Down Expand Up @@ -682,7 +682,7 @@ display:
exposed: true
expose:
operator_id: field_media_image_alt_1_op
label: 'Alt Text'
label: 'Search Alt Text'
description: ''
use_operator: false
operator: field_media_image_alt_1_op
Expand Down Expand Up @@ -730,10 +730,9 @@ display:
name_1: name_1
field_media_image_1: field_media_image_1
field_media_image_caption: field_media_image_caption
status: status
changed: changed
operations: operations
default: '-1'
default: changed
info:
views_bulk_operations_bulk_form:
align: ''
Expand Down Expand Up @@ -768,16 +767,9 @@ display:
separator: ''
empty_column: false
responsive: ''
status:
sortable: true
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
changed:
sortable: true
default_sort_order: asc
default_sort_order: desc
align: ''
separator: ''
empty_column: false
Expand Down
9 changes: 7 additions & 2 deletions docroot/modules/humsci/hs_views_helper/hs_views_helper.module
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,13 @@ function hs_views_helper_views_post_execute(ViewExecutable $view) {
* Implements hook_views_pre_view().
*/
function hs_views_helper_views_pre_view(ViewExecutable $view, $display_id, array &$args) {
$display_options = &$view->getDisplay()->options;
$default_options = &$view->getDisplay()->default_display->options;
$display = $view->getDisplay();
$display_options = &$display->options;
$default_display = &$display;
if (!empty($display->default_display)) {
$default_display = &$display->default_display;
}
$default_options = &$default_display->options;
$filters = !empty($display_options['filters']) ? $display_options['filters'] : $default_options['filters'];

if (
Expand Down

0 comments on commit b4702c4

Please sign in to comment.