From 20c502cedd758b91e2286b21f2a3133e5b36c29b Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 12 Sep 2017 10:42:47 +0200 Subject: [PATCH 001/134] Add search_api and facet module --- composer.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/composer.json b/composer.json index 8ac9f9930..b007330da 100644 --- a/composer.json +++ b/composer.json @@ -107,6 +107,7 @@ "drupal/entity_browser": "1.3", "drupal/entity_reference_revisions": "^1.0", "drupal/fb_instant_articles": "dev-1.x", + "drupal/facets": "^1.0", "drupal/field_group": "1.0-rc6", "drupal/focal_point": "^1.0", "drupal/google_analytics": "^2.0", @@ -129,6 +130,7 @@ "drupal/responsive_preview": "^1.0", "drupal/riddle_marketplace": "^2.0", "drupal/scheduler": "^1.0", + "drupal/search_api": "^1.0", "drupal/simple_sitemap": "^2.0", "drupal/shariff": "^1.0", "drupal/slick": "^1.0", From 8389d0d1e86d3427af9505b5584943db7b6eb1e3 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Mon, 16 Oct 2017 11:51:57 +0200 Subject: [PATCH 002/134] Add VBO and index+server --- composer.json | 1 + .../config/install/search_api.index.node.yml | 70 +++++++++++++++++++ .../install/search_api.server.database.yml | 16 +++++ 3 files changed, 87 insertions(+) create mode 100644 modules/thunder_search/config/install/search_api.index.node.yml create mode 100644 modules/thunder_search/config/install/search_api.server.database.yml diff --git a/composer.json b/composer.json index b007330da..b375ec83c 100644 --- a/composer.json +++ b/composer.json @@ -138,6 +138,7 @@ "drupal/thunder_admin": ">=1", "drupal/token": "^1.0", "drupal/video_embed_field": "^1.0", + "drupal/views_bulk_operations": "^1.0", "drupal/views_load_more": "dev-1.x", "valiton/harbourmaster": "~8.1", "bower-asset/dropzone": "^5.1", diff --git a/modules/thunder_search/config/install/search_api.index.node.yml b/modules/thunder_search/config/install/search_api.index.node.yml new file mode 100644 index 000000000..842431ffc --- /dev/null +++ b/modules/thunder_search/config/install/search_api.index.node.yml @@ -0,0 +1,70 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_paragraphs + - field.storage.paragraph.field_text + - field.storage.node.field_seo_title + - field.storage.node.field_teaser_text + - search_api.server.database + module: + - paragraphs + - search_api + - node +id: node +name: Node +description: '' +read_only: false +field_settings: + field_text: + label: 'Paragraphs » Paragraph » Text' + datasource_id: 'entity:node' + property_path: 'field_paragraphs:entity:field_text' + type: text + dependencies: + config: + - field.storage.node.field_paragraphs + - field.storage.paragraph.field_text + module: + - paragraphs + field_seo_title: + label: 'SEO Title' + datasource_id: 'entity:node' + property_path: field_seo_title + type: string + dependencies: + config: + - field.storage.node.field_seo_title + title: + label: Title + datasource_id: 'entity:node' + property_path: title + type: text + boost: !!float 3 + field_teaser_text: + label: 'Teaser Text' + datasource_id: 'entity:node' + property_path: field_teaser_text + type: text + boost: !!float 2 + dependencies: + config: + - field.storage.node.field_teaser_text +datasource_settings: + 'entity:node': + bundles: + default: true + selected: { } + languages: + default: true + selected: { } +processor_settings: + add_url: { } + aggregated_field: { } + rendered_item: { } +tracker_settings: + default: { } +options: + index_directly: true + cron_limit: 50 +server: database diff --git a/modules/thunder_search/config/install/search_api.server.database.yml b/modules/thunder_search/config/install/search_api.server.database.yml new file mode 100644 index 000000000..2eb398685 --- /dev/null +++ b/modules/thunder_search/config/install/search_api.server.database.yml @@ -0,0 +1,16 @@ +langcode: en +status: true +dependencies: + module: + - search_api_db +id: database +name: Database +description: '' +backend: search_api_db +backend_config: + database: 'default:default' + min_chars: 1 + partial_matches: false + autocomplete: + suggest_suffix: true + suggest_words: true From c192fbf438484de564596915896f56a2b1e6195a Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 17 Oct 2017 14:18:06 +0200 Subject: [PATCH 003/134] Add facets --- composer.json | 4 + .../config/install/facets.facet.author.yml | 68 ++ .../install/facets.facet.content_type.yml | 60 ++ .../facets.facet.promoted_to_front_page.yml | 67 ++ .../config/install/facets.facet.status.yml | 72 ++ .../facets.facet.sticky_at_top_of_lists.yml | 67 ++ ...pi__views_page__content_search__page_1.yml | 10 + .../config/install/search_api.index.node.yml | 197 ++++- .../install/search_api.server.database.yml | 3 +- .../install/views.view.content_search.yml | 816 ++++++++---------- .../src/Plugin/views/area/FacetBlock.php | 51 ++ .../thunder_search/thunder_search.info.yml | 9 + modules/thunder_search/thunder_search.module | 20 + thunder.info.yml | 1 + thunder.install | 2 + 15 files changed, 954 insertions(+), 493 deletions(-) create mode 100644 modules/thunder_search/config/install/facets.facet.author.yml create mode 100644 modules/thunder_search/config/install/facets.facet.content_type.yml create mode 100644 modules/thunder_search/config/install/facets.facet.promoted_to_front_page.yml create mode 100644 modules/thunder_search/config/install/facets.facet.status.yml create mode 100644 modules/thunder_search/config/install/facets.facet.sticky_at_top_of_lists.yml create mode 100644 modules/thunder_search/config/install/facets.facet_source.search_api__views_page__content_search__page_1.yml rename config/install/views.view.content.yml => modules/thunder_search/config/install/views.view.content_search.yml (60%) create mode 100644 modules/thunder_search/src/Plugin/views/area/FacetBlock.php create mode 100644 modules/thunder_search/thunder_search.info.yml create mode 100644 modules/thunder_search/thunder_search.module diff --git a/composer.json b/composer.json index b375ec83c..71617b588 100644 --- a/composer.json +++ b/composer.json @@ -76,6 +76,10 @@ }, "drupal/media_entity_pinterest": { "Media name always 'h'": "https://www.drupal.org/files/issues/media_name_always_h-2837977-8.patch" + }, + "drupal/search_api": { + "Support entity 'operations' in Views": "https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch", + "Facets not shown on view of overridden system route": "https://www.drupal.org/files/issues/2916754-2.patch" } } }, diff --git a/modules/thunder_search/config/install/facets.facet.author.yml b/modules/thunder_search/config/install/facets.facet.author.yml new file mode 100644 index 000000000..0a8e1da32 --- /dev/null +++ b/modules/thunder_search/config/install/facets.facet.author.yml @@ -0,0 +1,68 @@ +langcode: en +status: true +dependencies: + config: + - search_api.index.node + - views.view.content_search + module: + - search_api +id: author +name: Author +url_alias: author +weight: 0 +min_count: 1 +show_only_one_result: false +field_identifier: uid +facet_source_id: 'search_api:views_page__content_search__page_1' +widget: + type: checkbox + config: + show_numbers: false + soft_limit: 0 + soft_limit_settings: + show_less_label: 'Show less' + show_more_label: 'Show more' +query_operator: or +use_hierarchy: false +expand_hierarchy: false +enable_parent_when_child_gets_disabled: true +hard_limit: 10 +exclude: false +only_visible_when_facet_source_is_visible: true +processor_configs: + active_widget_order: + processor_id: active_widget_order + weights: + sort: -10 + settings: + sort: DESC + count_widget_order: + processor_id: count_widget_order + weights: + sort: -10 + settings: + sort: DESC + display_value_widget_order: + processor_id: display_value_widget_order + weights: + sort: -10 + settings: + sort: ASC + hide_1_result_facet: + processor_id: hide_1_result_facet + weights: + build: -10 + settings: { } + uid_to_username_callback: + processor_id: uid_to_username_callback + weights: + build: 5 + settings: { } + url_processor_handler: + processor_id: url_processor_handler + weights: + pre_query: -10 + build: -10 + settings: { } +empty_behavior: + behavior: none diff --git a/modules/thunder_search/config/install/facets.facet.content_type.yml b/modules/thunder_search/config/install/facets.facet.content_type.yml new file mode 100644 index 000000000..6c4601a28 --- /dev/null +++ b/modules/thunder_search/config/install/facets.facet.content_type.yml @@ -0,0 +1,60 @@ +langcode: en +status: true +dependencies: + config: + - search_api.index.node + - views.view.content_search + module: + - search_api +id: content_type +name: 'Content type' +url_alias: content_type +weight: 0 +min_count: 1 +show_only_one_result: true +field_identifier: type +facet_source_id: 'search_api:views_page__content_search__page_1' +widget: + type: dropdown + config: + show_numbers: false + default_option_label: Choose +query_operator: or +use_hierarchy: false +expand_hierarchy: false +enable_parent_when_child_gets_disabled: true +hard_limit: 0 +exclude: false +only_visible_when_facet_source_is_visible: true +processor_configs: + active_widget_order: + processor_id: active_widget_order + weights: + sort: -10 + settings: + sort: DESC + count_widget_order: + processor_id: count_widget_order + weights: + sort: -10 + settings: + sort: DESC + display_value_widget_order: + processor_id: display_value_widget_order + weights: + sort: -10 + settings: + sort: ASC + translate_entity: + processor_id: translate_entity + weights: + build: 5 + settings: { } + url_processor_handler: + processor_id: url_processor_handler + weights: + pre_query: -10 + build: -10 + settings: { } +empty_behavior: + behavior: none diff --git a/modules/thunder_search/config/install/facets.facet.promoted_to_front_page.yml b/modules/thunder_search/config/install/facets.facet.promoted_to_front_page.yml new file mode 100644 index 000000000..ebf18e804 --- /dev/null +++ b/modules/thunder_search/config/install/facets.facet.promoted_to_front_page.yml @@ -0,0 +1,67 @@ +langcode: en +status: true +dependencies: + config: + - search_api.index.node + - views.view.content_search + module: + - search_api +id: promoted_to_front_page +name: 'Promoted to front page' +url_alias: promoted_to_front_page +weight: 0 +min_count: 1 +show_only_one_result: true +field_identifier: promote +facet_source_id: 'search_api:views_page__content_search__page_1' +widget: + type: dropdown + config: + show_numbers: false + default_option_label: Choose +query_operator: or +use_hierarchy: false +expand_hierarchy: false +enable_parent_when_child_gets_disabled: true +hard_limit: 0 +exclude: false +only_visible_when_facet_source_is_visible: true +processor_configs: + active_widget_order: + processor_id: active_widget_order + weights: + sort: -10 + settings: + sort: DESC + boolean_item: + processor_id: boolean_item + weights: + build: -10 + settings: + on_value: 'Yes' + off_value: 'No' + count_widget_order: + processor_id: count_widget_order + weights: + sort: -10 + settings: + sort: DESC + display_value_widget_order: + processor_id: display_value_widget_order + weights: + sort: -10 + settings: + sort: ASC + hide_1_result_facet: + processor_id: hide_1_result_facet + weights: + build: -10 + settings: { } + url_processor_handler: + processor_id: url_processor_handler + weights: + pre_query: -10 + build: -10 + settings: { } +empty_behavior: + behavior: none diff --git a/modules/thunder_search/config/install/facets.facet.status.yml b/modules/thunder_search/config/install/facets.facet.status.yml new file mode 100644 index 000000000..5ea3e2c3d --- /dev/null +++ b/modules/thunder_search/config/install/facets.facet.status.yml @@ -0,0 +1,72 @@ +langcode: en +status: true +dependencies: + config: + - search_api.index.node + - views.view.content_search + module: + - search_api +id: status +name: status +url_alias: status +weight: 0 +min_count: 1 +show_only_one_result: true +field_identifier: status +facet_source_id: 'search_api:views_page__content_search__page_1' +widget: + type: dropdown + config: + show_numbers: false + default_option_label: Choose +query_operator: or +use_hierarchy: false +expand_hierarchy: false +enable_parent_when_child_gets_disabled: true +hard_limit: 0 +exclude: false +only_visible_when_facet_source_is_visible: true +processor_configs: + active_widget_order: + processor_id: active_widget_order + weights: + sort: -10 + settings: + sort: DESC + boolean_item: + processor_id: boolean_item + weights: + build: -10 + settings: + on_value: Published + off_value: Unpublished + count_widget_order: + processor_id: count_widget_order + weights: + sort: -10 + settings: + sort: DESC + display_value_widget_order: + processor_id: display_value_widget_order + weights: + sort: -10 + settings: + sort: ASC + hide_1_result_facet: + processor_id: hide_1_result_facet + weights: + build: -10 + settings: { } + list_item: + processor_id: list_item + weights: + build: 5 + settings: { } + url_processor_handler: + processor_id: url_processor_handler + weights: + pre_query: -10 + build: -10 + settings: { } +empty_behavior: + behavior: none diff --git a/modules/thunder_search/config/install/facets.facet.sticky_at_top_of_lists.yml b/modules/thunder_search/config/install/facets.facet.sticky_at_top_of_lists.yml new file mode 100644 index 000000000..1ca836a73 --- /dev/null +++ b/modules/thunder_search/config/install/facets.facet.sticky_at_top_of_lists.yml @@ -0,0 +1,67 @@ +langcode: en +status: true +dependencies: + config: + - search_api.index.node + - views.view.content_search + module: + - search_api +id: sticky_at_top_of_lists +name: 'Sticky at top of lists' +url_alias: sticky_at_top_of_lists +weight: 0 +min_count: 1 +show_only_one_result: true +field_identifier: sticky +facet_source_id: 'search_api:views_page__content_search__page_1' +widget: + type: dropdown + config: + show_numbers: false + default_option_label: Choose +query_operator: or +use_hierarchy: false +expand_hierarchy: false +enable_parent_when_child_gets_disabled: true +hard_limit: 0 +exclude: false +only_visible_when_facet_source_is_visible: true +processor_configs: + active_widget_order: + processor_id: active_widget_order + weights: + sort: -10 + settings: + sort: DESC + boolean_item: + processor_id: boolean_item + weights: + build: -10 + settings: + on_value: 'Yes' + off_value: 'No' + count_widget_order: + processor_id: count_widget_order + weights: + sort: -10 + settings: + sort: DESC + display_value_widget_order: + processor_id: display_value_widget_order + weights: + sort: -10 + settings: + sort: ASC + hide_1_result_facet: + processor_id: hide_1_result_facet + weights: + build: -10 + settings: { } + url_processor_handler: + processor_id: url_processor_handler + weights: + pre_query: -10 + build: -10 + settings: { } +empty_behavior: + behavior: none diff --git a/modules/thunder_search/config/install/facets.facet_source.search_api__views_page__content_search__page_1.yml b/modules/thunder_search/config/install/facets.facet_source.search_api__views_page__content_search__page_1.yml new file mode 100644 index 000000000..3836b8f1e --- /dev/null +++ b/modules/thunder_search/config/install/facets.facet_source.search_api__views_page__content_search__page_1.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: search_api__views_page__content_search__page_1 +name: 'search_api:views_page__content_search__page_1' +filter_key: '' +url_processor: query_string +breadcrumb: + active: false + group: false diff --git a/modules/thunder_search/config/install/search_api.index.node.yml b/modules/thunder_search/config/install/search_api.index.node.yml index 842431ffc..e37d2dab6 100644 --- a/modules/thunder_search/config/install/search_api.index.node.yml +++ b/modules/thunder_search/config/install/search_api.index.node.yml @@ -1,55 +1,86 @@ langcode: en status: true dependencies: - config: - - field.storage.node.field_paragraphs - - field.storage.paragraph.field_text - - field.storage.node.field_seo_title - - field.storage.node.field_teaser_text - - search_api.server.database module: - - paragraphs + - user - search_api - node + config: + - search_api.server.database id: node name: Node description: '' read_only: false field_settings: - field_text: - label: 'Paragraphs » Paragraph » Text' - datasource_id: 'entity:node' - property_path: 'field_paragraphs:entity:field_text' + rendered_item: + label: 'Rendered HTML output' + property_path: rendered_item + type: text + configuration: + roles: + anonymous: anonymous + view_mode: + 'entity:node': + article: default + page: default + node_grants: + label: 'Node access information' + property_path: search_api_node_grants + type: string + indexed_locked: true + type_locked: true + hidden: true + label: + label: Label + property_path: aggregated_field type: text + boost: !!float 8 + configuration: + type: union + fields: + - 'entity:node/title' + status: + label: status + datasource_id: 'entity:node' + property_path: status + type: boolean + indexed_locked: true + type_locked: true + uid: + label: uid + datasource_id: 'entity:node' + property_path: uid + type: integer + indexed_locked: true + type_locked: true + name: + label: 'Authored by » User » Name' + datasource_id: 'entity:node' + property_path: 'uid:entity:name' + type: string dependencies: - config: - - field.storage.node.field_paragraphs - - field.storage.paragraph.field_text module: - - paragraphs - field_seo_title: - label: 'SEO Title' + - user + changed: + label: Changed + datasource_id: 'entity:node' + property_path: changed + type: date + type: + label: 'Content type' datasource_id: 'entity:node' - property_path: field_seo_title + property_path: type type: string - dependencies: - config: - - field.storage.node.field_seo_title - title: - label: Title + sticky: + label: 'Sticky at top of lists' datasource_id: 'entity:node' - property_path: title - type: text - boost: !!float 3 - field_teaser_text: - label: 'Teaser Text' + property_path: sticky + type: boolean + promote: + label: 'Promoted to front page' datasource_id: 'entity:node' - property_path: field_teaser_text - type: text - boost: !!float 2 - dependencies: - config: - - field.storage.node.field_teaser_text + property_path: promote + type: boolean datasource_settings: 'entity:node': bundles: @@ -61,7 +92,105 @@ datasource_settings: processor_settings: add_url: { } aggregated_field: { } + content_access: + weights: + preprocess_query: -30 + html_filter: + all_fields: true + fields: + - rendered_item + - label + - name + - type + title: true + alt: true + tags: + h1: 5 + h2: 3 + h3: 2 + strong: 2 + b: 2 + em: 1 + u: 1 + weights: + preprocess_index: -15 + preprocess_query: -15 + ignorecase: + all_fields: true + fields: + - rendered_item + - label + - name + - type + weights: + preprocess_index: -20 + preprocess_query: -20 rendered_item: { } + stopwords: + all_fields: true + fields: + - rendered_item + - label + stopwords: + - a + - an + - and + - are + - as + - at + - be + - but + - by + - for + - if + - in + - into + - is + - it + - 'no' + - not + - of + - 'on' + - or + - s + - such + - t + - that + - the + - their + - then + - there + - these + - they + - this + - to + - was + - will + - with + weights: + preprocess_index: -5 + preprocess_query: -2 + tokenizer: + all_fields: true + fields: + - rendered_item + - label + spaces: '' + overlap_cjk: 1 + minimum_word_size: '3' + weights: + preprocess_index: -6 + preprocess_query: -6 + transliteration: + all_fields: true + fields: + - rendered_item + - label + - name + - type + weights: + preprocess_index: -20 + preprocess_query: -20 tracker_settings: default: { } options: diff --git a/modules/thunder_search/config/install/search_api.server.database.yml b/modules/thunder_search/config/install/search_api.server.database.yml index 2eb398685..19289dea1 100644 --- a/modules/thunder_search/config/install/search_api.server.database.yml +++ b/modules/thunder_search/config/install/search_api.server.database.yml @@ -9,7 +9,8 @@ description: '' backend: search_api_db backend_config: database: 'default:default' - min_chars: 1 + database_text: '' + min_chars: 3 partial_matches: false autocomplete: suggest_suffix: true diff --git a/config/install/views.view.content.yml b/modules/thunder_search/config/install/views.view.content_search.yml similarity index 60% rename from config/install/views.view.content.yml rename to modules/thunder_search/config/install/views.view.content_search.yml index f1943d29b..bb53e910b 100644 --- a/config/install/views.view.content.yml +++ b/modules/thunder_search/config/install/views.view.content_search.yml @@ -5,21 +5,27 @@ dependencies: - field.storage.node.field_channel - field.storage.node.field_teaser_media - image.style.thumbnail + - search_api.index.node module: - - content_lock - media_entity - - node + - search_api + - thunder_search - user -id: content + - views_bulk_operations +id: content_search label: Content -module: node -description: 'Find and manage content.' -tag: default -base_table: node_field_data -base_field: nid +module: views +description: '' +tag: '' +base_table: search_api_index_node +base_field: search_api_id core: 8.x display: default: + display_plugin: default + id: default + display_title: Master + position: 0 display_options: access: type: perm @@ -27,13 +33,17 @@ display: perm: 'access content overview' cache: type: tag + options: { } query: type: views_query + options: + bypass_access: false + skip_access: false exposed_form: type: basic options: - submit_button: Filter - reset_button: true + submit_button: Apply + reset_button: false reset_button_label: Reset exposed_sorts_label: 'Sort by' expose_sort_order: true @@ -43,11 +53,23 @@ display: type: full options: items_per_page: 50 + offset: 0 + id: 0 + total_pages: null tags: - previous: '‹ Previous' - next: 'Next ›' + previous: ‹‹ + next: ›› first: '« First' last: 'Last »' + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + quantity: 9 style: type: table options: @@ -55,36 +77,33 @@ display: row_class: '' default_row_class: true override: true - sticky: true + sticky: false caption: '' summary: '' description: '' columns: - node_bulk_form: node_bulk_form + views_bulk_operations_bulk_form: views_bulk_operations_bulk_form field_teaser_media: field_teaser_media - title: title + label: label type: type field_channel: field_channel status: status publish_on: publish_on - is_locked: is_locked - name: name changed: changed - operations: operations + search_api_operations: search_api_operations + changed_1: changed_1 info: - node_bulk_form: + views_bulk_operations_bulk_form: align: '' separator: '' empty_column: false responsive: '' field_teaser_media: - sortable: false - default_sort_order: asc align: '' separator: '' empty_column: false - responsive: priority-low - title: + responsive: '' + label: sortable: true default_sort_order: asc align: '' @@ -92,83 +111,122 @@ display: empty_column: false responsive: '' type: - sortable: true - default_sort_order: asc align: '' separator: '' empty_column: false - responsive: priority-medium + responsive: '' field_channel: - sortable: true - default_sort_order: asc align: '' separator: '' empty_column: false - responsive: priority-low + responsive: '' status: - sortable: true - default_sort_order: asc align: '' separator: '' empty_column: false - responsive: priority-medium + responsive: '' publish_on: - sortable: true - default_sort_order: asc align: '' separator: '' empty_column: false - responsive: priority-low - is_locked: - sortable: true - default_sort_order: asc + responsive: '' + changed: align: '' separator: '' empty_column: false - responsive: priority-medium - name: - sortable: true - default_sort_order: asc + responsive: '' + search_api_operations: align: '' separator: '' empty_column: false - responsive: priority-low - changed: + responsive: '' + changed_1: sortable: true default_sort_order: desc - align: '' - separator: '' - empty_column: false - responsive: priority-low - operations: align: '' separator: '' empty_column: false responsive: '' - default: changed - empty_table: true + default: changed_1 + empty_table: false row: type: fields fields: - node_bulk_form: - id: node_bulk_form - table: node - field: node_bulk_form - label: '' + views_bulk_operations_bulk_form: + id: views_bulk_operations_bulk_form + table: views + field: views_bulk_operations_bulk_form + relationship: none + group_type: group + admin_label: '' + label: 'Views bulk operations' exclude: false alter: alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' element_default_classes: true empty: '' hide_empty: false empty_zero: false hide_alter_empty: true - plugin_id: node_bulk_form - entity_type: node + batch: 1 + batch_size: '10' + form_step: true + action_title: Action + selected_actions: + node_assign_owner_action: 0 + node_delete_action: node_delete_action + node_unpromote_action: 0 + node_promote_action: 0 + node_publish_action: node_publish_action + node_save_action: 0 + node_make_sticky_action: 0 + node_unpublish_by_keyword_action: 0 + node_unpublish_action: node_unpublish_action + node_make_unsticky_action: 0 + pathauto_update_alias: 0 + preconfiguration: + node_delete_action: + label_override: '' + node_publish_action: + label_override: '' + node_unpublish_action: + label_override: '' + plugin_id: views_bulk_operations_bulk_form field_teaser_media: id: field_teaser_media - table: node__field_teaser_media + table: search_api_datasource_node_entity_node field: field_teaser_media relationship: none group_type: group @@ -229,35 +287,93 @@ display: multi_type: separator separator: ', ' field_api_classes: false - plugin_id: field - title: - id: title - table: node_field_data - field: title + field_rendering: true + fallback_handler: search_api_entity + fallback_options: + link_to_item: false + multi_type: separator + multi_separator: ', ' + display_methods: + gallery: + display_method: label + view_mode: default + image: + display_method: label + view_mode: default + instagram: + display_method: label + view_mode: default + pinterest: + display_method: label + view_mode: default + twitter: + display_method: label + view_mode: default + video: + display_method: label + view_mode: default + entity_type: node + plugin_id: search_api_field + label: + id: label + table: search_api_index_node + field: label + relationship: none + group_type: group + admin_label: '' label: Title exclude: false alter: alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' element_default_classes: true empty: '' hide_empty: false empty_zero: false hide_alter_empty: true - entity_type: node - entity_field: title - type: string - settings: - link_to_entity: true - plugin_id: field + link_to_item: true + multi_type: separator + multi_separator: ', ' + plugin_id: search_api type: id: type - table: node_field_data + table: search_api_datasource_node_entity_node field: type relationship: none group_type: group admin_label: '' - label: 'Content type' + label: 'Content Type' exclude: false alter: alter_text: false @@ -290,7 +406,7 @@ display: element_class: '' element_label_type: '' element_label_class: '' - element_label_colon: true + element_label_colon: false element_wrapper_type: '' element_wrapper_class: '' element_default_classes: true @@ -312,12 +428,20 @@ display: multi_type: separator separator: ', ' field_api_classes: false + field_rendering: true + fallback_handler: search_api_entity + fallback_options: + link_to_item: false + multi_type: separator + multi_separator: ', ' + display_methods: + node_type: + display_method: label entity_type: node - entity_field: type - plugin_id: field + plugin_id: search_api_field field_channel: id: field_channel - table: node__field_channel + table: search_api_datasource_node_entity_node field: field_channel relationship: none group_type: group @@ -355,7 +479,7 @@ display: element_class: '' element_label_type: '' element_label_class: '' - element_label_colon: true + element_label_colon: false element_wrapper_type: '' element_wrapper_class: '' element_default_classes: true @@ -377,37 +501,29 @@ display: multi_type: separator separator: ', ' field_api_classes: false - plugin_id: field + field_rendering: true + fallback_handler: search_api_entity + fallback_options: + link_to_item: false + multi_type: separator + multi_separator: ', ' + display_methods: + channel: + display_method: label + view_mode: default + tags: + display_method: label + view_mode: default + entity_type: node + plugin_id: search_api_field status: id: status - table: node_field_data + table: search_api_datasource_node_entity_node field: status - label: Status - exclude: false - alter: - alter_text: false - element_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: boolean - settings: - format: custom - format_custom_true: Published - format_custom_false: Unpublished - plugin_id: field - entity_type: node - entity_field: status - publish_on: - id: publish_on - table: node_field_data - field: publish_on relationship: none group_type: group admin_label: '' - label: 'Publish on' + label: Status exclude: false alter: alter_text: false @@ -440,7 +556,7 @@ display: element_class: '' element_label_type: '' element_label_class: '' - element_label_colon: true + element_label_colon: false element_wrapper_type: '' element_wrapper_class: '' element_default_classes: true @@ -449,11 +565,11 @@ display: empty_zero: false hide_alter_empty: true click_sort_column: value - type: timestamp + type: boolean settings: - date_format: short - custom_date_format: '' - timezone: '' + format: custom + format_custom_true: Published + format_custom_false: Unpublished group_column: value group_columns: { } group_rows: true @@ -464,17 +580,26 @@ display: multi_type: separator separator: ', ' field_api_classes: false + field_rendering: true + fallback_handler: search_api_boolean + fallback_options: + type: yes-no + type_custom_true: '' + type_custom_false: '' + not: false + link_to_item: false + multi_type: separator + multi_separator: ', ' entity_type: node - entity_field: publish_on - plugin_id: field - is_locked: - id: is_locked - table: content_lock - field: is_locked + plugin_id: search_api_field + publish_on: + id: publish_on + table: search_api_datasource_node_entity_node + field: publish_on relationship: none group_type: group admin_label: '' - label: 'Is Locked' + label: 'Publish on' exclude: false alter: alter_text: false @@ -507,7 +632,7 @@ display: element_class: '' element_label_type: '' element_label_class: '' - element_label_colon: true + element_label_colon: false element_wrapper_type: '' element_wrapper_class: '' element_default_classes: true @@ -515,19 +640,38 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - type: yes-no - type_custom_true: '' - type_custom_false: '' - not: false - plugin_id: content_lock_field - name: - id: name - table: users_field_data - field: name - relationship: uid_1 + click_sort_column: value + type: timestamp + settings: + date_format: short + custom_date_format: '' + timezone: '' + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_rendering: true + fallback_handler: search_api + fallback_options: + link_to_item: false + multi_type: separator + multi_separator: ', ' + entity_type: node + plugin_id: search_api_field + changed_1: + id: changed_1 + table: search_api_index_node + field: changed + relationship: none group_type: group admin_label: '' - label: 'Lock owner' + label: Updated exclude: false alter: alter_text: false @@ -560,7 +704,7 @@ display: element_class: '' element_label_type: '' element_label_class: '' - element_label_colon: true + element_label_colon: false element_wrapper_type: '' element_wrapper_class: '' element_default_classes: true @@ -569,9 +713,11 @@ display: empty_zero: false hide_alter_empty: true click_sort_column: value - type: user_name + type: timestamp settings: - link_to_entity: true + date_format: short + custom_date_format: '' + timezone: '' group_column: value group_columns: { } group_rows: true @@ -582,39 +728,24 @@ display: multi_type: separator separator: ', ' field_api_classes: false - entity_type: user - entity_field: name - plugin_id: field - changed: - id: changed - table: node_field_data - field: changed - label: Updated - exclude: false - alter: - alter_text: false - element_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: timestamp - settings: - date_format: short + field_rendering: true + fallback_handler: search_api_date + fallback_options: + date_format: fallback custom_date_format: '' timezone: '' - plugin_id: field - entity_type: node - entity_field: changed - operations: - id: operations - table: node - field: operations + link_to_item: false + multi_type: separator + multi_separator: ', ' + plugin_id: search_api_field + search_api_operations: + id: search_api_operations + table: search_api_index_node + field: search_api_operations relationship: none group_type: group admin_label: '' - label: Operations + label: '' exclude: false alter: alter_text: false @@ -647,7 +778,7 @@ display: element_class: '' element_label_type: '' element_label_class: '' - element_label_colon: true + element_label_colon: false element_wrapper_type: '' element_wrapper_class: '' element_default_classes: true @@ -656,162 +787,26 @@ display: empty_zero: false hide_alter_empty: true destination: true - plugin_id: entity_operations + plugin_id: search_api_entity_operations filters: - status_extra: - id: status_extra - table: node_field_data - field: status_extra - operator: '=' - value: false - plugin_id: node_status - group: 1 - entity_type: node - status: - id: status - table: node_field_data - field: status - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '1' - group: 1 - exposed: true - expose: - operator_id: '' - label: Status - description: '' - use_operator: false - operator: status_op - identifier: status - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: true - group_info: - label: 'Published status' - description: '' - identifier: status - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: - 1: - title: Published - operator: '=' - value: '1' - 2: - title: Unpublished - operator: '=' - value: '0' - plugin_id: boolean - entity_type: node - entity_field: status - type: - id: type - table: node_field_data - field: type - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: type_op - label: 'Content type' - description: '' - use_operator: false - operator: type_op - identifier: type - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: bundle - entity_type: node - entity_field: type - title: - id: title - table: node_field_data - field: title + search_api_fulltext: + id: search_api_fulltext + table: search_api_index_node + field: search_api_fulltext relationship: none group_type: group admin_label: '' - operator: contains + operator: and value: '' group: 1 exposed: true expose: - operator_id: title_op - label: Title + operator_id: search_api_fulltext_op + label: 'Fulltext search' description: '' use_operator: false - operator: title_op - identifier: title - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: string - entity_type: node - entity_field: title - uid: - id: uid - table: node_field_data - field: uid - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: uid_op - label: 'Authored by' - description: '' - use_operator: false - operator: uid_op - identifier: uid + operator: search_api_fulltext_op + identifier: search_api_fulltext required: false remember: false multiple: false @@ -821,7 +816,6 @@ display: editor: '0' seo: '0' administrator: '0' - reduce: false is_grouped: false group_info: label: '' @@ -834,34 +828,34 @@ display: default_group: All default_group_multiple: { } group_items: { } - entity_type: node - entity_field: uid - plugin_id: user_name - langcode: - id: langcode - table: node_field_data - field: langcode + parse_mode: terms + min_length: 3 + fields: { } + plugin_id: search_api_fulltext + search_api_language: + id: search_api_language + table: search_api_index_node + field: search_api_language relationship: none group_type: group admin_label: '' operator: in - value: { } + value: + '***LANGUAGE_language_interface***': '***LANGUAGE_language_interface***' group: 1 - exposed: true + exposed: false expose: - operator_id: langcode_op - label: Language + operator_id: '' + label: '' description: '' use_operator: false - operator: langcode_op - identifier: langcode + operator: '' + identifier: '' required: false remember: false multiple: false remember_roles: authenticated: authenticated - anonymous: '0' - administrator: '0' reduce: false is_grouped: false group_info: @@ -875,191 +869,97 @@ display: default_group: All default_group_multiple: { } group_items: { } - plugin_id: language - entity_type: node - entity_field: langcode - promote: - id: promote - table: node_field_data - field: promote + plugin_id: search_api_language + sorts: + search_api_relevance: + id: search_api_relevance + table: search_api_index_node + field: search_api_relevance relationship: none group_type: group admin_label: '' - operator: '=' - value: '1' - group: 1 - exposed: true + order: ASC + exposed: false expose: - operator_id: '' - label: 'Promoted to front page status' - description: '' - use_operator: false - operator: promote_op - identifier: promote - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - editor: '0' - seo: '0' - administrator: '0' - is_grouped: true - group_info: - label: 'Promoted to front page' - description: '' - identifier: promote - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: - 1: - title: 'Yes' - operator: '=' - value: '1' - 2: - title: 'No' - operator: '=' - value: '0' - entity_type: node - entity_field: promote - plugin_id: boolean - sticky: - id: sticky - table: node_field_data - field: sticky + label: '' + plugin_id: search_api + title: Content + header: + result: + id: result + table: views + field: result relationship: none group_type: group admin_label: '' - operator: '=' - value: '1' - group: 1 - exposed: true - expose: - operator_id: '' - label: 'Sticky status' - description: '' - use_operator: false - operator: sticky_op - identifier: sticky - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - editor: '0' - seo: '0' - administrator: '0' - is_grouped: true - group_info: - label: 'Sticky at top of lists' - description: '' - identifier: sticky - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: - 1: - title: 'Yes' - operator: '=' - value: '1' - 2: - title: 'No' - operator: '=' - value: '0' - entity_type: node - entity_field: sticky - plugin_id: boolean - sorts: { } - title: Content - empty: - area_text_custom: - id: area_text_custom + empty: false + content: 'Displaying @start - @end of @total' + plugin_id: result + facet_block: + id: facet_block table: views - field: area_text_custom - empty: true - content: 'No content available.' - plugin_id: text_custom - arguments: { } - relationships: - uid: - id: uid - table: node_field_data - field: uid - admin_label: author - required: true - plugin_id: standard - uid_1: - id: uid_1 - table: content_lock - field: uid + field: facet_block relationship: none group_type: group - admin_label: 'Lock owner' - required: false - plugin_id: standard - show_admin_links: false + admin_label: '' + empty: false + plugin_id: facet_block + footer: { } + empty: { } + relationships: { } + arguments: { } + display_extenders: { } + use_ajax: false filter_groups: operator: AND groups: 1: AND - display_extenders: { } - display_plugin: default - display_title: Master - id: default - position: 0 cache_metadata: + max-age: 0 contexts: - 'languages:language_content' - 'languages:language_interface' - url - url.query_args - - user - - 'user.node_grants:view' - user.permissions - max-age: 0 tags: - 'config:field.storage.node.field_channel' - 'config:field.storage.node.field_teaser_media' page_1: display_options: - path: admin/content/node + path: admin/content menu: - type: 'default tab' + type: tab title: Content description: '' + expanded: false + parent: '' + weight: 1 + context: '0' menu_name: admin - weight: -10 - context: '' tab_options: type: normal title: Content description: 'Find and manage content' - menu_name: admin weight: -10 display_extenders: { } + cache: + type: none + defaults: + cache: false + exposed_block: true display_plugin: page display_title: Page id: page_1 position: 1 cache_metadata: + max-age: 0 contexts: - 'languages:language_content' - 'languages:language_interface' - url - url.query_args - - user - - 'user.node_grants:view' - user.permissions - max-age: 0 tags: - 'config:field.storage.node.field_channel' - 'config:field.storage.node.field_teaser_media' diff --git a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php new file mode 100644 index 000000000..32670fe45 --- /dev/null +++ b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php @@ -0,0 +1,51 @@ +getStorage('facets_facet') + ->loadMultiple(); + + $facetManager = \Drupal::service('facets.manager'); + $build = NULL; + foreach ($facets as $id => $facet) { + // No need to build the facet if it does not need to be visible. + if ($facet->getOnlyVisibleWhenFacetSourceIsVisible() && !$facet->getFacetSource()->isRenderedInCurrentRequest()) { + continue; + } + + $config = $facet->getFacetSource()->getDisplay()->getPluginDefinition(); + + if ($config['view_id'] == $this->view->id() && $config['view_display'] == $this->view->current_display) { + $built_facet = $facetManager->build($facet); + if ($built_facet) { + $build[$id] = ['#type' => 'container']; + $build[$id]['label'] = ['#markup' => $facet->label()]; + $build[$id]['element'] = $built_facet; + } + } + } + $build['_view'] = $this->view->display_handler->viewExposedFormBlocks(); + + // Return as render array. + return $build; + } + +} diff --git a/modules/thunder_search/thunder_search.info.yml b/modules/thunder_search/thunder_search.info.yml new file mode 100644 index 000000000..dda95a78c --- /dev/null +++ b/modules/thunder_search/thunder_search.info.yml @@ -0,0 +1,9 @@ +name: 'Thunder Search' +description: 'Provides better search integration for Thunder.' +type: module +core: 8.x +dependencies: + - facets:facets + - search_api:search_api_db + - views_bulk_operations:views_bulk_operations +package: Thunder diff --git a/modules/thunder_search/thunder_search.module b/modules/thunder_search/thunder_search.module new file mode 100644 index 000000000..888d51f7f --- /dev/null +++ b/modules/thunder_search/thunder_search.module @@ -0,0 +1,20 @@ + t('Facet block'), + 'help' => t('.'), + 'area' => [ + 'id' => 'facet_block', + ], + ]; + return $data; +} diff --git a/thunder.info.yml b/thunder.info.yml index 5cb05e389..89ed44da3 100644 --- a/thunder.info.yml +++ b/thunder.info.yml @@ -47,6 +47,7 @@ dependencies: - thunder_media - thunder_taxonomy - thunder_updater + - thunder_search themes: - thunder_base - thunder_admin diff --git a/thunder.install b/thunder.install index 13eb10491..56eb78b13 100644 --- a/thunder.install +++ b/thunder.install @@ -76,6 +76,8 @@ function thunder_install() { // Disable default media view, cause we have our own. View::load('media')->setStatus(FALSE)->save(); + \Drupal::service('config.installer')->installOptionalConfig(); + View::load('content')->setStatus(FALSE)->save(); \Drupal::service('thunder_updater.update_checklist')->markAllUpdates(); From 49dfacc4721f4341a35747977dc826923c077fbf Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 2 Nov 2017 13:58:36 +0100 Subject: [PATCH 004/134] Use facets dev --- composer.json | 4 ++-- drupal-org.make | 9 +++++++++ drupal-org.make.yml | 17 +++++++++++++++++ .../config/install/facets.facet.author.yml | 9 +++------ 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 71617b588..e76c8fc06 100644 --- a/composer.json +++ b/composer.json @@ -111,7 +111,7 @@ "drupal/entity_browser": "1.3", "drupal/entity_reference_revisions": "^1.0", "drupal/fb_instant_articles": "dev-1.x", - "drupal/facets": "^1.0", + "drupal/facets": "dev-1.x", "drupal/field_group": "1.0-rc6", "drupal/focal_point": "^1.0", "drupal/google_analytics": "^2.0", @@ -134,7 +134,7 @@ "drupal/responsive_preview": "^1.0", "drupal/riddle_marketplace": "^2.0", "drupal/scheduler": "^1.0", - "drupal/search_api": "^1.0", + "drupal/search_api": "1.5", "drupal/simple_sitemap": "^2.0", "drupal/shariff": "^1.0", "drupal/slick": "^1.0", diff --git a/drupal-org.make b/drupal-org.make index 592a51635..4f05c2a1e 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -44,6 +44,9 @@ projects[entity_browser][version] = 1.3 projects[entity_browser][patch][] = https://www.drupal.org/files/issues/2858438_6.patch projects[entity_reference_revisions][type] = module projects[entity_reference_revisions][version] = 1 +projects[facets][type] = module +projects[facets][download][url] = http://git.drupal.org/project/facets.git +projects[facets][download][branch] = 8.x-1.x projects[fb_instant_articles][type] = module projects[fb_instant_articles][download][url] = http://git.drupal.org/project/fb_instant_articles.git projects[fb_instant_articles][download][branch] = 8.x-1.x @@ -95,6 +98,10 @@ projects[responsive_preview][type] = module projects[responsive_preview][version] = 1 projects[riddle_marketplace][type] = module projects[riddle_marketplace][version] = 2 +projects[search_api][type] = module +projects[search_api][version] = 1.5 +projects[search_api][patch][] = https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch +projects[search_api][patch][] = https://www.drupal.org/files/issues/2916754-2.patch projects[scheduler][type] = module projects[scheduler][version] = 1 projects[shariff][type] = module @@ -120,6 +127,8 @@ projects[infinite_module][download][tag] = 8.x-1.0-beta6 projects[infinite][type] = theme projects[infinite][download][url] = http://git.drupal.org/sandbox/gos77/2677750.git projects[infinite][download][tag] = 8.x-1.0-beta7 +projects[views_bulk_operations][type] = module +projects[views_bulk_operations][version] = 1 projects[video_embed_field][type] = module projects[video_embed_field][version] = 1 projects[views_load_more][type] = module diff --git a/drupal-org.make.yml b/drupal-org.make.yml index d1f6cbc58..c0ee1c9ef 100644 --- a/drupal-org.make.yml +++ b/drupal-org.make.yml @@ -90,6 +90,12 @@ projects: type: "module" version: "1" + facets: + type: "module" + download: + url: "http://git.drupal.org/project/facets.git" + branch: "8.x-1.x" + fb_instant_articles: type: "module" download: @@ -191,6 +197,13 @@ projects: type: "module" version: "2" + search_api: + type: "module" + version: "1.5" + patch: + - "https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch" + - "https://www.drupal.org/files/issues/2916754-2.patch" + scheduler: type: "module" version: "1" @@ -241,6 +254,10 @@ projects: url: "http://git.drupal.org/sandbox/gos77/2677750.git" tag: "8.x-1.0-beta7" + views_bulk_operations: + type: "module" + version: "1" + video_embed_field: type: "module" version: "1" diff --git a/modules/thunder_search/config/install/facets.facet.author.yml b/modules/thunder_search/config/install/facets.facet.author.yml index 0a8e1da32..2bc776ec4 100644 --- a/modules/thunder_search/config/install/facets.facet.author.yml +++ b/modules/thunder_search/config/install/facets.facet.author.yml @@ -11,17 +11,14 @@ name: Author url_alias: author weight: 0 min_count: 1 -show_only_one_result: false +show_only_one_result: true field_identifier: uid facet_source_id: 'search_api:views_page__content_search__page_1' widget: - type: checkbox + type: dropdown config: show_numbers: false - soft_limit: 0 - soft_limit_settings: - show_less_label: 'Show less' - show_more_label: 'Show more' + default_option_label: Choose query_operator: or use_hierarchy: false expand_hierarchy: false From d2663588799375278f4dc732b0094ee961decc17 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 2 Nov 2017 16:30:34 +0100 Subject: [PATCH 005/134] Add toolbar --- modules/thunder_search/css/search_box.css | 24 ++++++++++ modules/thunder_search/images/ios7-search.png | Bin 0 -> 3361 bytes .../thunder_search.libraries.yml | 5 +++ modules/thunder_search/thunder_search.module | 41 ++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 modules/thunder_search/css/search_box.css create mode 100644 modules/thunder_search/images/ios7-search.png create mode 100644 modules/thunder_search/thunder_search.libraries.yml diff --git a/modules/thunder_search/css/search_box.css b/modules/thunder_search/css/search_box.css new file mode 100644 index 000000000..0bbd2beb5 --- /dev/null +++ b/modules/thunder_search/css/search_box.css @@ -0,0 +1,24 @@ +#toolbar-tab-search { + float: right; +} + +#toolbar-tab-search .form-item { + margin: 0.3em; +} + +#toolbar-tab-search .form-item, +#toolbar-tab-search input.button +{ + margin: 0.3em; + float: left; +} + +#toolbar-tab-search input.thunder-search-box { + color: #0c5c7f; + min-height: 32px; + height: 32px; + background: white url(../images/ios7-search.png) no-repeat scroll 7px 5px; + background-size: 20px; + padding-left: 30px; +} + diff --git a/modules/thunder_search/images/ios7-search.png b/modules/thunder_search/images/ios7-search.png new file mode 100644 index 0000000000000000000000000000000000000000..3b97bca8adc01d33e53b62a2b261cf5be10d19f5 GIT binary patch literal 3361 zcmcInc{tR2`~G}q7>sSmI%FNoK^be-jBRXVS0tR#ktNc+p@f<*=@To*#Unqil5^S{(pqn_59;Ia~0!#JbVF8g=j_8`7YAFv#Id=tKa*;SxC>k%1~$!3XmQ^v{pLHR zr86tGzTTOHFRK#|12yw)q5snGTJyUv{mreVnp=i%OFHzj{@g3E>Du?z=u|M3m2hTU zzDqy!RL|(AZp`7YzP95pE0mU`SML9%#~5j7&2I>;$)#ZOTrP?SzoJbDt2Nn(f9iJX zvc+|twPxD*Ti~32#B;=5pXYb>E(EF%EuT z_Ks=Pb&X>F@s6Hw1?&Cl2{WwPMfT^t2NIsfUP^IkE~%{@iyhGl*qbId#pW;FP4Z{wZ7sR}+)SIZY=n)*GK72iJz{FKA}II{L#+Q{O1djaY!< z4IH{&STg=3@TG6Hn}|SaL`IbNk2k=DtPgXON{`gzJ}oQt zXFPoNEBjm6qr0s|%VNLU>SG_=?wht=456R;fD5?U^yBvWl_wivd-6%3o4ql&s^1>B zE8w-=eDX$adko@dbC7yOi&ebzN%b60+DzC=k(aZ!uMWI{PgHh1D~QpH8aX~?!a4op z#HASh&m((e?-O>9Fx?0u>op#2$l$U~xMYs&%?1(FVE?O+M+k(d-ay*fwvHuc`i!v= zwxNGS_4#&eRe~w(y&yD$pB*VzzOZW2a({-@&d7fZ2cgxZnWO8I< zZ%wifWoxAjT%PBxm8*;1+e{t#s&USUr4=e8c)5KY?&9=mbFYp^iO58@U|`FKc86!< z`4h!wa*KtU^ytm}u#<%zH(!Pty}!t?1hy_m4KcE~9vZX?l=IBBW49&Oisg{}Of6R=BV}EsqFpm378Q-45}WwHyPub*y;Y5p8lHG+%p~Y>tV31B^^)MjM4s_l zYLCE+Vw8jpi-@^KNn;r(t(5g0BH`oHVSyIbo?C)YQ6tqr9&bm|1g%xw1Z7kQ1*7fI z##DINlDNl;v6?=1NkH2%ptS`qxvxCo5&^X(fkc+}X+F($Kz%I~VJi)($f7EkL`k3& z-{Bdm0mAGN#!{O-atuE%2rk^AMPU7IWNVM6?t3Ohl()}wP3G242wE=KlY2%YxM4T^ z@N(w(<*9~!QWD!=g>Gag8+_bjUQDz-AYcbkgt)MHnn*~}6L9z^!JCwPbI;i~$Uor}L37>6QEm73XId@#x^!r#1%!#k7NywN;p{X`+iR zuzz_zYMSY|*_19GL>)H!sVnueq>GwxeI$SBZedr+Zj}<-F16sicA0{7S-Cza%h`-z zWX@UF!xcmu2s!lPm01-1%gQDc^i8^%4I?PaRmDn73K9?;NzDs|(K0;wlSh;m;Au8F zgo)B0Nk#v0L*_gkqM{XFw6o2bRkDdag3k3gh-DWF4a{VVK|!v0M3e+b5JQnba|rDM zXnnxJKq`O_1_3H4YN{a2uLfio|0bNfh9`+4%0LYt)#n$sAjG0;8?A_&ecIJPO@e<;nw^}<>Zb@j6s7=NWBW-*n4FH1 zqeDf#4ZlwB8*%T=nvcv4G8EUNR479d1NgTzpueU^NTH&zh&X!@o` z&&3kk45z?T@ZIUpCP*qj5=Ut{h*m`G0h%$Efaib(sUe(X{R@zxa!UhIAI17Vg^a1h zzh3=*6&;DtC~eIJCxNI}47|exe+Maxd8V>JRIV4KltFj+B9YH?xJPHFw)I8jjw^zo zfrvA65S~~IebADp0TP;Qiu5k3$_Wg?-$W7H{b@Bj9R!Toch!%j7)ltaeY4F1DueRn zIpY2E+fj%gMvtvbu_B=#tHw$^o)0T86b5+WjGx)S^+Q$7N@bAx5#4yNUg5KwQHaAI z-TjSxD?7#8ab($Z`oa%oKqSKV+w5-v14%{s0+ERETwwgvz|?KJJ-XA)uY4E1_~+Dn z4*McpB9YSu<{ivcL*13M*fEE6%q2uZ_yA(DG~}RWOqH4n&%_2~>_4e)hpuu(f7ivC za}KRlL+|rix3Kry6~|>}E1P$86?m4$QTb=2+bRS#;VfYF&#tcYv|h8O+3H7 zL5kh!epJ}ngFAND#1K>Bn~CF2a*{+v@VzT~8LY50!gxn@>oCaaF~zlNa}Ts;UI#J6ASy` zbky_k!ig7%;i)EXQog9(FUku1H{Pi84x_(!cA`8Q^}i>z4vzPbp*QAy{Yh5?eNudp zw)k!{Wz$a7UY!DF1AVbxW1ijs*L}|L`K&vftC6tb%RlbyS~(I}%KjQsy_o0o$OBq^ zRT;e3eym3vOM;>XGfR;<(2hx;C$(%U&ACc0A&fxpIlD5rW`Sm}Z b1NirytMJS5c5G|k-y#=B4~GUjYT7>ma5k5{ literal 0 HcmV?d00001 diff --git a/modules/thunder_search/thunder_search.libraries.yml b/modules/thunder_search/thunder_search.libraries.yml new file mode 100644 index 000000000..04795e7d9 --- /dev/null +++ b/modules/thunder_search/thunder_search.libraries.yml @@ -0,0 +1,5 @@ +search_box: + version: VERSION + css: + theme: + css/search_box.css: {} diff --git a/modules/thunder_search/thunder_search.module b/modules/thunder_search/thunder_search.module index 888d51f7f..01c9ea9a4 100644 --- a/modules/thunder_search/thunder_search.module +++ b/modules/thunder_search/thunder_search.module @@ -18,3 +18,44 @@ function thunder_search_views_data() { ]; return $data; } + +/** + * Implements hook_toolbar(). + */ +function thunder_search_toolbar() { + $items = []; + $items['search'] = [ + '#cache' => [ + 'contexts' => [ + 'user.permissions', + ], + ], + ]; + + $items['search'] += array( + '#type' => 'toolbar_item', + 'tab' => array( + 'input' => [ + '#type' => 'textfield', + '#size' => 20, + '#attributes' => array( + 'class' => array('thunder-search-box'), + 'placeholder' => t('Search'), + ), + ], + 'tab1' => array( + '#type' => 'submit', + '#value' => 'Search', + ), + ), + '#wrapper_attributes' => array( + 'id' => 'toolbar-tab-search', + ), + '#attached' => array( + 'library' => array( + 'thunder_search/search_box', + ), + ), + ); + return $items; +} From b37766a35714d802a20af0624e68d8222e049fe5 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 7 Nov 2017 12:35:06 +0100 Subject: [PATCH 006/134] Style content overview and remove toolbar block --- modules/thunder_search/css/search_box.css | 24 ---------- modules/thunder_search/images/ios7-search.png | Bin 3361 -> 0 bytes .../src/Plugin/views/area/FacetBlock.php | 15 +++++-- modules/thunder_search/thunder_search.module | 41 ------------------ 4 files changed, 11 insertions(+), 69 deletions(-) delete mode 100644 modules/thunder_search/css/search_box.css delete mode 100644 modules/thunder_search/images/ios7-search.png diff --git a/modules/thunder_search/css/search_box.css b/modules/thunder_search/css/search_box.css deleted file mode 100644 index 0bbd2beb5..000000000 --- a/modules/thunder_search/css/search_box.css +++ /dev/null @@ -1,24 +0,0 @@ -#toolbar-tab-search { - float: right; -} - -#toolbar-tab-search .form-item { - margin: 0.3em; -} - -#toolbar-tab-search .form-item, -#toolbar-tab-search input.button -{ - margin: 0.3em; - float: left; -} - -#toolbar-tab-search input.thunder-search-box { - color: #0c5c7f; - min-height: 32px; - height: 32px; - background: white url(../images/ios7-search.png) no-repeat scroll 7px 5px; - background-size: 20px; - padding-left: 30px; -} - diff --git a/modules/thunder_search/images/ios7-search.png b/modules/thunder_search/images/ios7-search.png deleted file mode 100644 index 3b97bca8adc01d33e53b62a2b261cf5be10d19f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3361 zcmcInc{tR2`~G}q7>sSmI%FNoK^be-jBRXVS0tR#ktNc+p@f<*=@To*#Unqil5^S{(pqn_59;Ia~0!#JbVF8g=j_8`7YAFv#Id=tKa*;SxC>k%1~$!3XmQ^v{pLHR zr86tGzTTOHFRK#|12yw)q5snGTJyUv{mreVnp=i%OFHzj{@g3E>Du?z=u|M3m2hTU zzDqy!RL|(AZp`7YzP95pE0mU`SML9%#~5j7&2I>;$)#ZOTrP?SzoJbDt2Nn(f9iJX zvc+|twPxD*Ti~32#B;=5pXYb>E(EF%EuT z_Ks=Pb&X>F@s6Hw1?&Cl2{WwPMfT^t2NIsfUP^IkE~%{@iyhGl*qbId#pW;FP4Z{wZ7sR}+)SIZY=n)*GK72iJz{FKA}II{L#+Q{O1djaY!< z4IH{&STg=3@TG6Hn}|SaL`IbNk2k=DtPgXON{`gzJ}oQt zXFPoNEBjm6qr0s|%VNLU>SG_=?wht=456R;fD5?U^yBvWl_wivd-6%3o4ql&s^1>B zE8w-=eDX$adko@dbC7yOi&ebzN%b60+DzC=k(aZ!uMWI{PgHh1D~QpH8aX~?!a4op z#HASh&m((e?-O>9Fx?0u>op#2$l$U~xMYs&%?1(FVE?O+M+k(d-ay*fwvHuc`i!v= zwxNGS_4#&eRe~w(y&yD$pB*VzzOZW2a({-@&d7fZ2cgxZnWO8I< zZ%wifWoxAjT%PBxm8*;1+e{t#s&USUr4=e8c)5KY?&9=mbFYp^iO58@U|`FKc86!< z`4h!wa*KtU^ytm}u#<%zH(!Pty}!t?1hy_m4KcE~9vZX?l=IBBW49&Oisg{}Of6R=BV}EsqFpm378Q-45}WwHyPub*y;Y5p8lHG+%p~Y>tV31B^^)MjM4s_l zYLCE+Vw8jpi-@^KNn;r(t(5g0BH`oHVSyIbo?C)YQ6tqr9&bm|1g%xw1Z7kQ1*7fI z##DINlDNl;v6?=1NkH2%ptS`qxvxCo5&^X(fkc+}X+F($Kz%I~VJi)($f7EkL`k3& z-{Bdm0mAGN#!{O-atuE%2rk^AMPU7IWNVM6?t3Ohl()}wP3G242wE=KlY2%YxM4T^ z@N(w(<*9~!QWD!=g>Gag8+_bjUQDz-AYcbkgt)MHnn*~}6L9z^!JCwPbI;i~$Uor}L37>6QEm73XId@#x^!r#1%!#k7NywN;p{X`+iR zuzz_zYMSY|*_19GL>)H!sVnueq>GwxeI$SBZedr+Zj}<-F16sicA0{7S-Cza%h`-z zWX@UF!xcmu2s!lPm01-1%gQDc^i8^%4I?PaRmDn73K9?;NzDs|(K0;wlSh;m;Au8F zgo)B0Nk#v0L*_gkqM{XFw6o2bRkDdag3k3gh-DWF4a{VVK|!v0M3e+b5JQnba|rDM zXnnxJKq`O_1_3H4YN{a2uLfio|0bNfh9`+4%0LYt)#n$sAjG0;8?A_&ecIJPO@e<;nw^}<>Zb@j6s7=NWBW-*n4FH1 zqeDf#4ZlwB8*%T=nvcv4G8EUNR479d1NgTzpueU^NTH&zh&X!@o` z&&3kk45z?T@ZIUpCP*qj5=Ut{h*m`G0h%$Efaib(sUe(X{R@zxa!UhIAI17Vg^a1h zzh3=*6&;DtC~eIJCxNI}47|exe+Maxd8V>JRIV4KltFj+B9YH?xJPHFw)I8jjw^zo zfrvA65S~~IebADp0TP;Qiu5k3$_Wg?-$W7H{b@Bj9R!Toch!%j7)ltaeY4F1DueRn zIpY2E+fj%gMvtvbu_B=#tHw$^o)0T86b5+WjGx)S^+Q$7N@bAx5#4yNUg5KwQHaAI z-TjSxD?7#8ab($Z`oa%oKqSKV+w5-v14%{s0+ERETwwgvz|?KJJ-XA)uY4E1_~+Dn z4*McpB9YSu<{ivcL*13M*fEE6%q2uZ_yA(DG~}RWOqH4n&%_2~>_4e)hpuu(f7ivC za}KRlL+|rix3Kry6~|>}E1P$86?m4$QTb=2+bRS#;VfYF&#tcYv|h8O+3H7 zL5kh!epJ}ngFAND#1K>Bn~CF2a*{+v@VzT~8LY50!gxn@>oCaaF~zlNa}Ts;UI#J6ASy` zbky_k!ig7%;i)EXQog9(FUku1H{Pi84x_(!cA`8Q^}i>z4vzPbp*QAy{Yh5?eNudp zw)k!{Wz$a7UY!DF1AVbxW1ijs*L}|L`K&vftC6tb%RlbyS~(I}%KjQsy_o0o$OBq^ zRT;e3eym3vOM;>XGfR;<(2hx;C$(%U&ACc0A&fxpIlD5rW`Sm}Z b1NirytMJS5c5G|k-y#=B4~GUjYT7>ma5k5{ diff --git a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php index 32670fe45..351d4813e 100644 --- a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php +++ b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php @@ -24,7 +24,7 @@ public function render($empty = FALSE) { ->loadMultiple(); $facetManager = \Drupal::service('facets.manager'); - $build = NULL; + $build = ['#type' => 'container', '#attributes' => ['class' => 'form--inline']]; foreach ($facets as $id => $facet) { // No need to build the facet if it does not need to be visible. if ($facet->getOnlyVisibleWhenFacetSourceIsVisible() && !$facet->getFacetSource()->isRenderedInCurrentRequest()) { @@ -36,9 +36,16 @@ public function render($empty = FALSE) { if ($config['view_id'] == $this->view->id() && $config['view_display'] == $this->view->current_display) { $built_facet = $facetManager->build($facet); if ($built_facet) { - $build[$id] = ['#type' => 'container']; - $build[$id]['label'] = ['#markup' => $facet->label()]; - $build[$id]['element'] = $built_facet; + $build[$id] = [ + '#type' => 'container', + '#attributes' => ['class' => 'form-item'], + 'label' => [ + '#type' => 'label', + '#title' => $facet->label(), + '#title_display' => 'above', + ], + 'element' => $built_facet, + ]; } } } diff --git a/modules/thunder_search/thunder_search.module b/modules/thunder_search/thunder_search.module index 01c9ea9a4..888d51f7f 100644 --- a/modules/thunder_search/thunder_search.module +++ b/modules/thunder_search/thunder_search.module @@ -18,44 +18,3 @@ function thunder_search_views_data() { ]; return $data; } - -/** - * Implements hook_toolbar(). - */ -function thunder_search_toolbar() { - $items = []; - $items['search'] = [ - '#cache' => [ - 'contexts' => [ - 'user.permissions', - ], - ], - ]; - - $items['search'] += array( - '#type' => 'toolbar_item', - 'tab' => array( - 'input' => [ - '#type' => 'textfield', - '#size' => 20, - '#attributes' => array( - 'class' => array('thunder-search-box'), - 'placeholder' => t('Search'), - ), - ], - 'tab1' => array( - '#type' => 'submit', - '#value' => 'Search', - ), - ), - '#wrapper_attributes' => array( - 'id' => 'toolbar-tab-search', - ), - '#attached' => array( - 'library' => array( - 'thunder_search/search_box', - ), - ), - ); - return $items; -} From 5df7e384786108299c354f8e246bc3a97b2eb40a Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 7 Nov 2017 14:03:45 +0100 Subject: [PATCH 007/134] Add db command patch --- scripts/travis/04-install-thunder.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/travis/04-install-thunder.sh b/scripts/travis/04-install-thunder.sh index fd0c4742d..2132d0524 100755 --- a/scripts/travis/04-install-thunder.sh +++ b/scripts/travis/04-install-thunder.sh @@ -59,6 +59,8 @@ apply_patches() { # apply cookie expire patch for javascript tests #wget https://www.drupal.org/files/issues/test-session-expire-2771547-64.patch #patch -p1 < test-session-expire-2771547-64.patch + wget https://www.drupal.org/files/issues/character_set_wrongly-2921548-2.patch + patch -p1 < character_set_wrongly-2921548-2.patch } create_testing_dump() { From 5641d3d404d60db6642c48c8f5e504337cb26eea Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 7 Nov 2017 14:12:25 +0100 Subject: [PATCH 008/134] Apply patches before dump creation --- scripts/travis/04-install-thunder.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/travis/04-install-thunder.sh b/scripts/travis/04-install-thunder.sh index 2132d0524..934eada6e 100755 --- a/scripts/travis/04-install-thunder.sh +++ b/scripts/travis/04-install-thunder.sh @@ -84,6 +84,6 @@ else install_thunder ${TEST_DIR}/docroot fi -create_testing_dump - apply_patches + +create_testing_dump From f938bec04e5d00fde21f543dcd00df3151e3773f Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 7 Nov 2017 16:25:49 +0100 Subject: [PATCH 009/134] Try to fix config --- composer.json | 11 +++++++++-- drupal-org-core.make.yml | 2 +- drupal-org.make | 4 +++- drupal-org.make.yml | 5 ++++- .../config/install/search_api.server.database.yml | 1 - .../config/install/views.view.content_search.yml | 6 +++--- 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index e76c8fc06..86df3809c 100644 --- a/composer.json +++ b/composer.json @@ -79,7 +79,14 @@ }, "drupal/search_api": { "Support entity 'operations' in Views": "https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch", - "Facets not shown on view of overridden system route": "https://www.drupal.org/files/issues/2916754-2.patch" + "Facets not shown on view of overridden system route": "https://www.drupal.org/files/issues/2916754-2.patch", + "Don't export database_text in config files": "https://www.drupal.org/files/issues/don_t_export-2921582-2.patch" + }, + "drupal/views_bulk_operations": { + "'Undefined index: entity type' when using vbo with search api based view": "https://www.drupal.org/files/issues/undefined_index_-2921563-2.patch" + }, + "drupal/facets": { + "Add schema for all processors and test that it works": "https://www.drupal.org/files/issues/2919439-3.patch" } } }, @@ -142,7 +149,7 @@ "drupal/thunder_admin": ">=1", "drupal/token": "^1.0", "drupal/video_embed_field": "^1.0", - "drupal/views_bulk_operations": "^1.0", + "drupal/views_bulk_operations": "1.0-beta2", "drupal/views_load_more": "dev-1.x", "valiton/harbourmaster": "~8.1", "bower-asset/dropzone": "^5.1", diff --git a/drupal-org-core.make.yml b/drupal-org-core.make.yml index 78a676036..39eb8e489 100644 --- a/drupal-org-core.make.yml +++ b/drupal-org-core.make.yml @@ -4,4 +4,4 @@ core: 8.x projects: drupal: type: core - version: 8.4.0 + version: 8.4.2 diff --git a/drupal-org.make b/drupal-org.make index 4f05c2a1e..379d586ab 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -102,6 +102,7 @@ projects[search_api][type] = module projects[search_api][version] = 1.5 projects[search_api][patch][] = https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch projects[search_api][patch][] = https://www.drupal.org/files/issues/2916754-2.patch +projects[search_api][patch][] = https://www.drupal.org/files/issues/don_t_export-2921582-2.patch projects[scheduler][type] = module projects[scheduler][version] = 1 projects[shariff][type] = module @@ -128,7 +129,8 @@ projects[infinite][type] = theme projects[infinite][download][url] = http://git.drupal.org/sandbox/gos77/2677750.git projects[infinite][download][tag] = 8.x-1.0-beta7 projects[views_bulk_operations][type] = module -projects[views_bulk_operations][version] = 1 +projects[views_bulk_operations][version] = 1.0-beta2 +projects[views_bulk_operations][patch][] = https://www.drupal.org/files/issues/undefined_index_-2921563-2.patch projects[video_embed_field][type] = module projects[video_embed_field][version] = 1 projects[views_load_more][type] = module diff --git a/drupal-org.make.yml b/drupal-org.make.yml index c0ee1c9ef..c4988c2d0 100644 --- a/drupal-org.make.yml +++ b/drupal-org.make.yml @@ -203,6 +203,7 @@ projects: patch: - "https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch" - "https://www.drupal.org/files/issues/2916754-2.patch" + - "https://www.drupal.org/files/issues/don_t_export-2921582-2.patch" scheduler: type: "module" @@ -256,7 +257,9 @@ projects: views_bulk_operations: type: "module" - version: "1" + version: "1.0-beta2" + patch: + - "https://www.drupal.org/files/issues/undefined_index_-2921563-2.patch" video_embed_field: type: "module" diff --git a/modules/thunder_search/config/install/search_api.server.database.yml b/modules/thunder_search/config/install/search_api.server.database.yml index 19289dea1..16ffcbc2c 100644 --- a/modules/thunder_search/config/install/search_api.server.database.yml +++ b/modules/thunder_search/config/install/search_api.server.database.yml @@ -9,7 +9,6 @@ description: '' backend: search_api_db backend_config: database: 'default:default' - database_text: '' min_chars: 3 partial_matches: false autocomplete: diff --git a/modules/thunder_search/config/install/views.view.content_search.yml b/modules/thunder_search/config/install/views.view.content_search.yml index bb53e910b..91b05c863 100644 --- a/modules/thunder_search/config/install/views.view.content_search.yml +++ b/modules/thunder_search/config/install/views.view.content_search.yml @@ -35,7 +35,7 @@ display: type: tag options: { } query: - type: views_query + type: search_api_query options: bypass_access: false skip_access: false @@ -200,8 +200,8 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - batch: 1 - batch_size: '10' + batch: true + batch_size: 10 form_step: true action_title: Action selected_actions: From 9f8ddb550e33af66664368d77f86c74878c1d0f2 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Fri, 10 Nov 2017 16:07:04 +0100 Subject: [PATCH 010/134] Fix config --- composer.json | 3 --- .../{install => optional}/facets.facet.author.yml | 0 .../facets.facet.content_type.yml | 0 .../facets.facet.promoted_to_front_page.yml | 0 .../{install => optional}/facets.facet.status.yml | 0 .../facets.facet.sticky_at_top_of_lists.yml | 0 ...earch_api__views_page__content_search__page_1.yml | 0 .../{install => optional}/search_api.index.node.yml | 0 .../search_api.server.database.yml | 0 .../views.view.content_search.yml | 5 +++-- tests/src/Functional/InstalledConfigurationTest.php | 12 ++++++++++++ 11 files changed, 15 insertions(+), 5 deletions(-) rename modules/thunder_search/config/{install => optional}/facets.facet.author.yml (100%) rename modules/thunder_search/config/{install => optional}/facets.facet.content_type.yml (100%) rename modules/thunder_search/config/{install => optional}/facets.facet.promoted_to_front_page.yml (100%) rename modules/thunder_search/config/{install => optional}/facets.facet.status.yml (100%) rename modules/thunder_search/config/{install => optional}/facets.facet.sticky_at_top_of_lists.yml (100%) rename modules/thunder_search/config/{install => optional}/facets.facet_source.search_api__views_page__content_search__page_1.yml (100%) rename modules/thunder_search/config/{install => optional}/search_api.index.node.yml (100%) rename modules/thunder_search/config/{install => optional}/search_api.server.database.yml (100%) rename modules/thunder_search/config/{install => optional}/views.view.content_search.yml (99%) diff --git a/composer.json b/composer.json index 86df3809c..83696e6ab 100644 --- a/composer.json +++ b/composer.json @@ -84,9 +84,6 @@ }, "drupal/views_bulk_operations": { "'Undefined index: entity type' when using vbo with search api based view": "https://www.drupal.org/files/issues/undefined_index_-2921563-2.patch" - }, - "drupal/facets": { - "Add schema for all processors and test that it works": "https://www.drupal.org/files/issues/2919439-3.patch" } } }, diff --git a/modules/thunder_search/config/install/facets.facet.author.yml b/modules/thunder_search/config/optional/facets.facet.author.yml similarity index 100% rename from modules/thunder_search/config/install/facets.facet.author.yml rename to modules/thunder_search/config/optional/facets.facet.author.yml diff --git a/modules/thunder_search/config/install/facets.facet.content_type.yml b/modules/thunder_search/config/optional/facets.facet.content_type.yml similarity index 100% rename from modules/thunder_search/config/install/facets.facet.content_type.yml rename to modules/thunder_search/config/optional/facets.facet.content_type.yml diff --git a/modules/thunder_search/config/install/facets.facet.promoted_to_front_page.yml b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml similarity index 100% rename from modules/thunder_search/config/install/facets.facet.promoted_to_front_page.yml rename to modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml diff --git a/modules/thunder_search/config/install/facets.facet.status.yml b/modules/thunder_search/config/optional/facets.facet.status.yml similarity index 100% rename from modules/thunder_search/config/install/facets.facet.status.yml rename to modules/thunder_search/config/optional/facets.facet.status.yml diff --git a/modules/thunder_search/config/install/facets.facet.sticky_at_top_of_lists.yml b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml similarity index 100% rename from modules/thunder_search/config/install/facets.facet.sticky_at_top_of_lists.yml rename to modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml diff --git a/modules/thunder_search/config/install/facets.facet_source.search_api__views_page__content_search__page_1.yml b/modules/thunder_search/config/optional/facets.facet_source.search_api__views_page__content_search__page_1.yml similarity index 100% rename from modules/thunder_search/config/install/facets.facet_source.search_api__views_page__content_search__page_1.yml rename to modules/thunder_search/config/optional/facets.facet_source.search_api__views_page__content_search__page_1.yml diff --git a/modules/thunder_search/config/install/search_api.index.node.yml b/modules/thunder_search/config/optional/search_api.index.node.yml similarity index 100% rename from modules/thunder_search/config/install/search_api.index.node.yml rename to modules/thunder_search/config/optional/search_api.index.node.yml diff --git a/modules/thunder_search/config/install/search_api.server.database.yml b/modules/thunder_search/config/optional/search_api.server.database.yml similarity index 100% rename from modules/thunder_search/config/install/search_api.server.database.yml rename to modules/thunder_search/config/optional/search_api.server.database.yml diff --git a/modules/thunder_search/config/install/views.view.content_search.yml b/modules/thunder_search/config/optional/views.view.content_search.yml similarity index 99% rename from modules/thunder_search/config/install/views.view.content_search.yml rename to modules/thunder_search/config/optional/views.view.content_search.yml index 91b05c863..a66b0b8be 100644 --- a/modules/thunder_search/config/install/views.view.content_search.yml +++ b/modules/thunder_search/config/optional/views.view.content_search.yml @@ -32,7 +32,7 @@ display: options: perm: 'access content overview' cache: - type: tag + type: none options: { } query: type: search_api_query @@ -944,7 +944,8 @@ display: weight: -10 display_extenders: { } cache: - type: none + type: search_api_tag + options: { } defaults: cache: false exposed_block: true diff --git a/tests/src/Functional/InstalledConfigurationTest.php b/tests/src/Functional/InstalledConfigurationTest.php index 50a80dea5..19730a246 100644 --- a/tests/src/Functional/InstalledConfigurationTest.php +++ b/tests/src/Functional/InstalledConfigurationTest.php @@ -92,6 +92,12 @@ class InstalledConfigurationTest extends ThunderBaseTest { 'tour.tour.language', 'tour.tour.language-add', 'tour.tour.language-edit', + 'tour.tour.search-api-index', + 'tour.tour.search-api-index-fields', + 'tour.tour.search-api-index-form', + 'tour.tour.search-api-index-processors', + 'tour.tour.search-api-server', + 'tour.tour.search-api-server-form', // Focal point schema issue. 'image.style.entity_browser_thumbnail', @@ -164,6 +170,12 @@ class InstalledConfigurationTest extends ThunderBaseTest { ], 'status' => TRUE, ], + 'views.view.content' => [ + 'dependencies' => [ + 'config' => TRUE, + ], + 'status' => FALSE, + ], // Changed on installation. 'views.view.glossary' => [ From 0b7fed7a94587ea5fa4c3a98fa0b9fcaeca119ff Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 14 Nov 2017 12:50:54 +0100 Subject: [PATCH 011/134] WIP --- .../config/optional/facets.facet.author.yml | 2 +- .../optional/facets.facet.content_type.yml | 7 +- .../facets.facet.promoted_to_front_page.yml | 2 +- .../config/optional/facets.facet.status.yml | 2 +- .../facets.facet.sticky_at_top_of_lists.yml | 2 +- ....node.yml => search_api.index.content.yml} | 32 +++++- .../optional/views.view.content_search.yml | 103 ++++++++++++++---- .../src/Plugin/views/area/FacetBlock.php | 4 +- modules/thunder_search/thunder_search.install | 10 ++ .../Thunder/OptionalModule/ThunderDemo.php | 2 +- .../Thunder/OptionalModule/ThunderSearch.php | 17 +++ thunder.info.yml | 1 - thunder.install | 2 - 13 files changed, 150 insertions(+), 36 deletions(-) rename modules/thunder_search/config/optional/{search_api.index.node.yml => search_api.index.content.yml} (84%) create mode 100644 modules/thunder_search/thunder_search.install create mode 100644 src/Plugin/Thunder/OptionalModule/ThunderSearch.php diff --git a/modules/thunder_search/config/optional/facets.facet.author.yml b/modules/thunder_search/config/optional/facets.facet.author.yml index 2bc776ec4..3b0eb1612 100644 --- a/modules/thunder_search/config/optional/facets.facet.author.yml +++ b/modules/thunder_search/config/optional/facets.facet.author.yml @@ -2,7 +2,7 @@ langcode: en status: true dependencies: config: - - search_api.index.node + - search_api.index.content - views.view.content_search module: - search_api diff --git a/modules/thunder_search/config/optional/facets.facet.content_type.yml b/modules/thunder_search/config/optional/facets.facet.content_type.yml index 6c4601a28..2a0a89f90 100644 --- a/modules/thunder_search/config/optional/facets.facet.content_type.yml +++ b/modules/thunder_search/config/optional/facets.facet.content_type.yml @@ -2,7 +2,7 @@ langcode: en status: true dependencies: config: - - search_api.index.node + - search_api.index.content - views.view.content_search module: - search_api @@ -45,6 +45,11 @@ processor_configs: sort: -10 settings: sort: ASC + hide_1_result_facet: + processor_id: hide_1_result_facet + weights: + build: -10 + settings: { } translate_entity: processor_id: translate_entity weights: diff --git a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml index ebf18e804..966f8a50f 100644 --- a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml +++ b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml @@ -2,7 +2,7 @@ langcode: en status: true dependencies: config: - - search_api.index.node + - search_api.index.content - views.view.content_search module: - search_api diff --git a/modules/thunder_search/config/optional/facets.facet.status.yml b/modules/thunder_search/config/optional/facets.facet.status.yml index 5ea3e2c3d..bb277fd8e 100644 --- a/modules/thunder_search/config/optional/facets.facet.status.yml +++ b/modules/thunder_search/config/optional/facets.facet.status.yml @@ -2,7 +2,7 @@ langcode: en status: true dependencies: config: - - search_api.index.node + - search_api.index.content - views.view.content_search module: - search_api diff --git a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml index 1ca836a73..c6ffd297a 100644 --- a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml +++ b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml @@ -2,7 +2,7 @@ langcode: en status: true dependencies: config: - - search_api.index.node + - search_api.index.content - views.view.content_search module: - search_api diff --git a/modules/thunder_search/config/optional/search_api.index.node.yml b/modules/thunder_search/config/optional/search_api.index.content.yml similarity index 84% rename from modules/thunder_search/config/optional/search_api.index.node.yml rename to modules/thunder_search/config/optional/search_api.index.content.yml index e37d2dab6..898e6e6c6 100644 --- a/modules/thunder_search/config/optional/search_api.index.node.yml +++ b/modules/thunder_search/config/optional/search_api.index.content.yml @@ -5,10 +5,12 @@ dependencies: - user - search_api - node + - media_entity + - taxonomy config: - search_api.server.database -id: node -name: Node +id: content +name: Content description: '' read_only: false field_settings: @@ -23,6 +25,16 @@ field_settings: 'entity:node': article: default page: default + 'entity:media': + gallery: default + image: default + instagram: default + pinterest: default + twitter: default + video: default + 'entity:taxonomy_term': + channel: default + tags: default node_grants: label: 'Node access information' property_path: search_api_node_grants @@ -39,6 +51,8 @@ field_settings: type: union fields: - 'entity:node/title' + - 'entity:media/name' + - 'entity:taxonomy_term/name' status: label: status datasource_id: 'entity:node' @@ -89,6 +103,20 @@ datasource_settings: languages: default: true selected: { } + 'entity:media': + bundles: + default: true + selected: { } + languages: + default: true + selected: { } + 'entity:taxonomy_term': + bundles: + default: true + selected: { } + languages: + default: true + selected: { } processor_settings: add_url: { } aggregated_field: { } diff --git a/modules/thunder_search/config/optional/views.view.content_search.yml b/modules/thunder_search/config/optional/views.view.content_search.yml index a66b0b8be..8aa21fc1c 100644 --- a/modules/thunder_search/config/optional/views.view.content_search.yml +++ b/modules/thunder_search/config/optional/views.view.content_search.yml @@ -5,7 +5,7 @@ dependencies: - field.storage.node.field_channel - field.storage.node.field_teaser_media - image.style.thumbnail - - search_api.index.node + - search_api.index.content module: - media_entity - search_api @@ -17,7 +17,7 @@ label: Content module: views description: '' tag: '' -base_table: search_api_index_node +base_table: search_api_index_content base_field: search_api_id core: 8.x display: @@ -205,28 +205,46 @@ display: form_step: true action_title: Action selected_actions: - node_assign_owner_action: 0 - node_delete_action: node_delete_action - node_unpromote_action: 0 - node_promote_action: 0 + media_delete_action: 0 + media_publish_action: 0 + media_save_action: 0 + media_unpublish_action: 0 + node_assign_owner_action: node_assign_owner_action + node_unpromote_action: node_unpromote_action + node_promote_action: node_promote_action node_publish_action: node_publish_action - node_save_action: 0 - node_make_sticky_action: 0 - node_unpublish_by_keyword_action: 0 + node_save_action: node_save_action + node_make_sticky_action: node_make_sticky_action + node_unpublish_by_keyword_action: node_unpublish_by_keyword_action node_unpublish_action: node_unpublish_action - node_make_unsticky_action: 0 + node_make_unsticky_action: node_make_unsticky_action + views_bulk_operations_delete_entity: views_bulk_operations_delete_entity pathauto_update_alias: 0 preconfiguration: - node_delete_action: + node_assign_owner_action: + label_override: '' + node_unpromote_action: + label_override: '' + node_promote_action: label_override: '' node_publish_action: label_override: '' + node_save_action: + label_override: '' + node_make_sticky_action: + label_override: '' + node_unpublish_by_keyword_action: + label_override: '' node_unpublish_action: label_override: '' + node_make_unsticky_action: + label_override: '' + views_bulk_operations_delete_entity: + label_override: '' plugin_id: views_bulk_operations_bulk_form field_teaser_media: id: field_teaser_media - table: search_api_datasource_node_entity_node + table: search_api_datasource_content_entity_node field: field_teaser_media relationship: none group_type: group @@ -316,7 +334,7 @@ display: plugin_id: search_api_field label: id: label - table: search_api_index_node + table: search_api_index_content field: label relationship: none group_type: group @@ -368,7 +386,7 @@ display: plugin_id: search_api type: id: type - table: search_api_datasource_node_entity_node + table: search_api_datasource_content_entity_node field: type relationship: none group_type: group @@ -441,7 +459,7 @@ display: plugin_id: search_api_field field_channel: id: field_channel - table: search_api_datasource_node_entity_node + table: search_api_datasource_content_entity_node field: field_channel relationship: none group_type: group @@ -518,7 +536,7 @@ display: plugin_id: search_api_field status: id: status - table: search_api_datasource_node_entity_node + table: search_api_datasource_content_entity_node field: status relationship: none group_type: group @@ -594,7 +612,7 @@ display: plugin_id: search_api_field publish_on: id: publish_on - table: search_api_datasource_node_entity_node + table: search_api_datasource_content_entity_node field: publish_on relationship: none group_type: group @@ -666,7 +684,7 @@ display: plugin_id: search_api_field changed_1: id: changed_1 - table: search_api_index_node + table: search_api_index_content field: changed relationship: none group_type: group @@ -740,7 +758,7 @@ display: plugin_id: search_api_field search_api_operations: id: search_api_operations - table: search_api_index_node + table: search_api_index_content field: search_api_operations relationship: none group_type: group @@ -791,7 +809,7 @@ display: filters: search_api_fulltext: id: search_api_fulltext - table: search_api_index_node + table: search_api_index_content field: search_api_fulltext relationship: none group_type: group @@ -834,7 +852,7 @@ display: plugin_id: search_api_fulltext search_api_language: id: search_api_language - table: search_api_index_node + table: search_api_index_content field: search_api_language relationship: none group_type: group @@ -870,10 +888,49 @@ display: default_group_multiple: { } group_items: { } plugin_id: search_api_language + search_api_datasource: + id: search_api_datasource + table: search_api_index_content + field: search_api_datasource + relationship: none + group_type: group + admin_label: '' + operator: or + value: + 'entity:node': 'entity:node' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + reduce_duplicates: false + plugin_id: search_api_datasource sorts: search_api_relevance: id: search_api_relevance - table: search_api_index_node + table: search_api_index_content field: search_api_relevance relationship: none group_type: group @@ -944,7 +1001,7 @@ display: weight: -10 display_extenders: { } cache: - type: search_api_tag + type: none options: { } defaults: cache: false diff --git a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php index 351d4813e..ac3268536 100644 --- a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php +++ b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php @@ -24,7 +24,8 @@ public function render($empty = FALSE) { ->loadMultiple(); $facetManager = \Drupal::service('facets.manager'); - $build = ['#type' => 'container', '#attributes' => ['class' => 'form--inline']]; + $build = ['#type' => 'container', '#attributes' => ['class' => 'form--inline clearfix']]; + $build['_view'] = $this->view->display_handler->viewExposedFormBlocks(); foreach ($facets as $id => $facet) { // No need to build the facet if it does not need to be visible. if ($facet->getOnlyVisibleWhenFacetSourceIsVisible() && !$facet->getFacetSource()->isRenderedInCurrentRequest()) { @@ -49,7 +50,6 @@ public function render($empty = FALSE) { } } } - $build['_view'] = $this->view->display_handler->viewExposedFormBlocks(); // Return as render array. return $build; diff --git a/modules/thunder_search/thunder_search.install b/modules/thunder_search/thunder_search.install new file mode 100644 index 000000000..1808245c9 --- /dev/null +++ b/modules/thunder_search/thunder_search.install @@ -0,0 +1,10 @@ +setStatus(FALSE)->save(); +} diff --git a/src/Plugin/Thunder/OptionalModule/ThunderDemo.php b/src/Plugin/Thunder/OptionalModule/ThunderDemo.php index 11df18fef..559357566 100644 --- a/src/Plugin/Thunder/OptionalModule/ThunderDemo.php +++ b/src/Plugin/Thunder/OptionalModule/ThunderDemo.php @@ -11,7 +11,7 @@ * description = @Translation("Installs demo content to show how Thunder works."), * type = "module", * standardlyEnabled = 1, - * weight = -1 + * weight = -2 * ) */ class ThunderDemo extends AbstractOptionalModule {} diff --git a/src/Plugin/Thunder/OptionalModule/ThunderSearch.php b/src/Plugin/Thunder/OptionalModule/ThunderSearch.php new file mode 100644 index 000000000..abc0ac438 --- /dev/null +++ b/src/Plugin/Thunder/OptionalModule/ThunderSearch.php @@ -0,0 +1,17 @@ +setStatus(FALSE)->save(); - \Drupal::service('config.installer')->installOptionalConfig(); - View::load('content')->setStatus(FALSE)->save(); \Drupal::service('thunder_updater.update_checklist')->markAllUpdates(); From 41a566c00f8dff9b28219b5e9966a0db78fb10ec Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 14 Nov 2017 14:24:10 +0100 Subject: [PATCH 012/134] Fix cs --- modules/thunder_search/thunder_search.install | 5 +++++ tests/src/Functional/InstalledConfigurationTest.php | 1 + 2 files changed, 6 insertions(+) diff --git a/modules/thunder_search/thunder_search.install b/modules/thunder_search/thunder_search.install index 1808245c9..51726ab13 100644 --- a/modules/thunder_search/thunder_search.install +++ b/modules/thunder_search/thunder_search.install @@ -1,5 +1,10 @@ Date: Wed, 15 Nov 2017 11:39:06 +0100 Subject: [PATCH 013/134] WIP --- ...content_type.yml => facets.facet.type.yml} | 12 +- .../optional/search_api.index.content.yml | 55 +- .../optional/views.view.content_search.yml | 178 +--- .../optional/views.view.media_search.yml | 892 ++++++++++++++++++ 4 files changed, 963 insertions(+), 174 deletions(-) rename modules/thunder_search/config/optional/{facets.facet.content_type.yml => facets.facet.type.yml} (88%) create mode 100644 modules/thunder_search/config/optional/views.view.media_search.yml diff --git a/modules/thunder_search/config/optional/facets.facet.content_type.yml b/modules/thunder_search/config/optional/facets.facet.type.yml similarity index 88% rename from modules/thunder_search/config/optional/facets.facet.content_type.yml rename to modules/thunder_search/config/optional/facets.facet.type.yml index 2a0a89f90..432ea2302 100644 --- a/modules/thunder_search/config/optional/facets.facet.content_type.yml +++ b/modules/thunder_search/config/optional/facets.facet.type.yml @@ -1,3 +1,4 @@ +uuid: b7dd447a-f51c-4276-9037-b2bb391d7e52 langcode: en status: true dependencies: @@ -6,9 +7,9 @@ dependencies: - views.view.content_search module: - search_api -id: content_type -name: 'Content type' -url_alias: content_type +id: type +name: Type +url_alias: type weight: 0 min_count: 1 show_only_one_result: true @@ -50,11 +51,6 @@ processor_configs: weights: build: -10 settings: { } - translate_entity: - processor_id: translate_entity - weights: - build: 5 - settings: { } url_processor_handler: processor_id: url_processor_handler weights: diff --git a/modules/thunder_search/config/optional/search_api.index.content.yml b/modules/thunder_search/config/optional/search_api.index.content.yml index 898e6e6c6..de643f954 100644 --- a/modules/thunder_search/config/optional/search_api.index.content.yml +++ b/modules/thunder_search/config/optional/search_api.index.content.yml @@ -8,6 +8,7 @@ dependencies: - media_entity - taxonomy config: + - field.storage.node.field_channel - search_api.server.database id: content name: Content @@ -53,6 +54,36 @@ field_settings: - 'entity:node/title' - 'entity:media/name' - 'entity:taxonomy_term/name' + type: + label: Type + property_path: aggregated_field + type: string + configuration: + type: union + fields: + - 'entity:node/type' + - 'entity:media/bundle' + - 'entity:taxonomy_term/vid' + changed: + label: Changed + property_path: aggregated_field + type: date + configuration: + type: union + fields: + - 'entity:node/changed' + - 'entity:media/changed' + - 'entity:taxonomy_term/changed' + published: + label: Published + property_path: aggregated_field + type: boolean + configuration: + type: union + fields: + - 'entity:node/status' + - 'entity:media/status' + - 'entity:taxonomy_term/status' status: label: status datasource_id: 'entity:node' @@ -75,16 +106,6 @@ field_settings: dependencies: module: - user - changed: - label: Changed - datasource_id: 'entity:node' - property_path: changed - type: date - type: - label: 'Content type' - datasource_id: 'entity:node' - property_path: type - type: string sticky: label: 'Sticky at top of lists' datasource_id: 'entity:node' @@ -95,6 +116,14 @@ field_settings: datasource_id: 'entity:node' property_path: promote type: boolean + field_channel: + label: Channel + datasource_id: 'entity:node' + property_path: field_channel + type: integer + dependencies: + config: + - field.storage.node.field_channel datasource_settings: 'entity:node': bundles: @@ -128,8 +157,8 @@ processor_settings: fields: - rendered_item - label - - name - type + - name title: true alt: true tags: @@ -148,8 +177,8 @@ processor_settings: fields: - rendered_item - label - - name - type + - name weights: preprocess_index: -20 preprocess_query: -20 @@ -214,8 +243,8 @@ processor_settings: fields: - rendered_item - label - - name - type + - name weights: preprocess_index: -20 preprocess_query: -20 diff --git a/modules/thunder_search/config/optional/views.view.content_search.yml b/modules/thunder_search/config/optional/views.view.content_search.yml index 8aa21fc1c..82bbaeebd 100644 --- a/modules/thunder_search/config/optional/views.view.content_search.yml +++ b/modules/thunder_search/config/optional/views.view.content_search.yml @@ -2,7 +2,6 @@ langcode: en status: true dependencies: config: - - field.storage.node.field_channel - field.storage.node.field_teaser_media - image.style.thumbnail - search_api.index.content @@ -89,9 +88,8 @@ display: field_channel: field_channel status: status publish_on: publish_on - changed: changed - search_api_operations: search_api_operations changed_1: changed_1 + search_api_operations: search_api_operations info: views_bulk_operations_bulk_form: align: '' @@ -111,6 +109,8 @@ display: empty_column: false responsive: '' type: + sortable: true + default_sort_order: asc align: '' separator: '' empty_column: false @@ -130,7 +130,9 @@ display: separator: '' empty_column: false responsive: '' - changed: + changed_1: + sortable: true + default_sort_order: desc align: '' separator: '' empty_column: false @@ -140,13 +142,6 @@ display: separator: '' empty_column: false responsive: '' - changed_1: - sortable: true - default_sort_order: desc - align: '' - separator: '' - empty_column: false - responsive: '' default: changed_1 empty_table: false row: @@ -386,12 +381,12 @@ display: plugin_id: search_api type: id: type - table: search_api_datasource_content_entity_node + table: search_api_index_content field: type relationship: none group_type: group admin_label: '' - label: 'Content Type' + label: Type exclude: false alter: alter_text: false @@ -424,80 +419,7 @@ display: element_class: '' element_label_type: '' element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: false - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - field_rendering: true - fallback_handler: search_api_entity - fallback_options: - link_to_item: false - multi_type: separator - multi_separator: ', ' - display_methods: - node_type: - display_method: label - entity_type: node - plugin_id: search_api_field - field_channel: - id: field_channel - table: search_api_datasource_content_entity_node - field: field_channel - relationship: none - group_type: group - admin_label: '' - label: Channel - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false + element_label_colon: true element_wrapper_type: '' element_wrapper_class: '' element_default_classes: true @@ -505,43 +427,18 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: true - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false + link_to_item: false multi_type: separator - separator: ', ' - field_api_classes: false - field_rendering: true - fallback_handler: search_api_entity - fallback_options: - link_to_item: false - multi_type: separator - multi_separator: ', ' - display_methods: - channel: - display_method: label - view_mode: default - tags: - display_method: label - view_mode: default - entity_type: node - plugin_id: search_api_field - status: - id: status - table: search_api_datasource_content_entity_node - field: status + multi_separator: ', ' + plugin_id: search_api + published: + id: published + table: search_api_index_content + field: published relationship: none group_type: group admin_label: '' - label: Status + label: Published exclude: false alter: alter_text: false @@ -574,7 +471,7 @@ display: element_class: '' element_label_type: '' element_label_class: '' - element_label_colon: false + element_label_colon: true element_wrapper_type: '' element_wrapper_class: '' element_default_classes: true @@ -582,34 +479,10 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - click_sort_column: value - type: boolean - settings: - format: custom - format_custom_true: Published - format_custom_false: Unpublished - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false + link_to_item: false multi_type: separator - separator: ', ' - field_api_classes: false - field_rendering: true - fallback_handler: search_api_boolean - fallback_options: - type: yes-no - type_custom_true: '' - type_custom_false: '' - not: false - link_to_item: false - multi_type: separator - multi_separator: ', ' - entity_type: node - plugin_id: search_api_field + multi_separator: ', ' + plugin_id: search_api publish_on: id: publish_on table: search_api_datasource_content_entity_node @@ -692,7 +565,7 @@ display: label: Updated exclude: false alter: - alter_text: false + alter_text: true text: '' make_link: false path: '' @@ -730,6 +603,9 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true + link_to_item: 0 + multi_type: separator + multi_separator: ', ' click_sort_column: value type: timestamp settings: @@ -743,7 +619,6 @@ display: delta_offset: 0 delta_reversed: false delta_first_last: false - multi_type: separator separator: ', ' field_api_classes: false field_rendering: true @@ -980,7 +855,6 @@ display: - url.query_args - user.permissions tags: - - 'config:field.storage.node.field_channel' - 'config:field.storage.node.field_teaser_media' page_1: display_options: @@ -1002,7 +876,6 @@ display: display_extenders: { } cache: type: none - options: { } defaults: cache: false exposed_block: true @@ -1019,5 +892,4 @@ display: - url.query_args - user.permissions tags: - - 'config:field.storage.node.field_channel' - 'config:field.storage.node.field_teaser_media' diff --git a/modules/thunder_search/config/optional/views.view.media_search.yml b/modules/thunder_search/config/optional/views.view.media_search.yml new file mode 100644 index 000000000..32494b27c --- /dev/null +++ b/modules/thunder_search/config/optional/views.view.media_search.yml @@ -0,0 +1,892 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.media.field_expires + - image.style.thumbnail + - search_api.index.content + module: + - datetime + - image + - search_api + - thunder_search + - user + - views_bulk_operations +id: media_search +label: Media +module: views +description: '' +tag: '' +base_table: search_api_index_content +base_field: search_api_id +core: 8.x +display: + default: + display_plugin: default + id: default + display_title: Master + position: 0 + display_options: + access: + type: perm + options: + perm: 'access content overview' + cache: + type: none + options: { } + query: + type: search_api_query + options: + bypass_access: false + skip_access: false + exposed_form: + type: basic + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + pager: + type: full + options: + items_per_page: 50 + offset: 0 + id: 0 + total_pages: null + tags: + previous: ‹‹ + next: ›› + first: '« First' + last: 'Last »' + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + quantity: 9 + style: + type: table + options: + grouping: { } + row_class: '' + default_row_class: true + override: true + sticky: false + caption: '' + summary: '' + description: '' + columns: + views_bulk_operations_bulk_form: views_bulk_operations_bulk_form + thumbnail: thumbnail + label: label + type: type + status: status + field_expires: field_expires + changed: changed + search_api_operations: search_api_operations + info: + views_bulk_operations_bulk_form: + align: '' + separator: '' + empty_column: false + responsive: '' + thumbnail: + align: '' + separator: '' + empty_column: false + responsive: '' + label: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + type: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + status: + align: '' + separator: '' + empty_column: false + responsive: '' + field_expires: + align: '' + separator: '' + empty_column: false + responsive: '' + changed: + align: '' + separator: '' + empty_column: false + responsive: '' + search_api_operations: + align: '' + separator: '' + empty_column: false + responsive: '' + default: '-1' + empty_table: false + row: + type: fields + fields: + views_bulk_operations_bulk_form: + id: views_bulk_operations_bulk_form + table: views + field: views_bulk_operations_bulk_form + relationship: none + group_type: group + admin_label: '' + label: 'Views bulk operations' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + batch: true + batch_size: 10 + form_step: true + action_title: Action + selected_actions: + media_delete_action: 0 + media_publish_action: 0 + media_save_action: 0 + media_unpublish_action: 0 + node_assign_owner_action: node_assign_owner_action + node_unpromote_action: node_unpromote_action + node_promote_action: node_promote_action + node_publish_action: node_publish_action + node_save_action: node_save_action + node_make_sticky_action: node_make_sticky_action + node_unpublish_by_keyword_action: node_unpublish_by_keyword_action + node_unpublish_action: node_unpublish_action + node_make_unsticky_action: node_make_unsticky_action + views_bulk_operations_delete_entity: views_bulk_operations_delete_entity + pathauto_update_alias: 0 + preconfiguration: + node_assign_owner_action: + label_override: '' + node_unpromote_action: + label_override: '' + node_promote_action: + label_override: '' + node_publish_action: + label_override: '' + node_save_action: + label_override: '' + node_make_sticky_action: + label_override: '' + node_unpublish_by_keyword_action: + label_override: '' + node_unpublish_action: + label_override: '' + node_make_unsticky_action: + label_override: '' + views_bulk_operations_delete_entity: + label_override: '' + plugin_id: views_bulk_operations_bulk_form + thumbnail: + id: thumbnail + table: search_api_datasource_content_entity_media + field: thumbnail + relationship: none + group_type: group + admin_label: '' + label: Thumbnail + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: target_id + type: image + settings: + image_style: thumbnail + image_link: '' + group_column: '' + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_rendering: true + fallback_handler: search_api + fallback_options: + link_to_item: false + multi_type: separator + multi_separator: ', ' + entity_type: media + plugin_id: search_api_field + label: + id: label + table: search_api_index_content + field: label + relationship: none + group_type: group + admin_label: '' + label: Title + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + link_to_item: true + multi_type: separator + multi_separator: ', ' + plugin_id: search_api + type: + id: type + table: search_api_index_content + field: type + relationship: none + group_type: group + admin_label: '' + label: Type + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + link_to_item: false + multi_type: separator + multi_separator: ', ' + plugin_id: search_api + status: + id: status + table: search_api_datasource_content_entity_media + field: status + relationship: none + group_type: group + admin_label: '' + label: Status + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: boolean + settings: + format: custom + format_custom_true: Published + format_custom_false: Unpublished + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_rendering: true + fallback_handler: search_api_boolean + fallback_options: + type: yes-no + type_custom_true: '' + type_custom_false: '' + not: false + link_to_item: false + multi_type: separator + multi_separator: ', ' + entity_type: media + plugin_id: search_api_field + field_expires: + id: field_expires + table: search_api_datasource_content_entity_media + field: field_expires + relationship: none + group_type: group + admin_label: '' + label: Expires + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: datetime_default + settings: + timezone_override: '' + format_type: short + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_rendering: true + fallback_handler: search_api + fallback_options: + link_to_item: false + multi_type: separator + multi_separator: ', ' + entity_type: media + plugin_id: search_api_field + changed: + id: changed + table: search_api_datasource_content_entity_media + field: changed + relationship: none + group_type: group + admin_label: '' + label: Updated + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: timestamp + settings: + date_format: short + custom_date_format: '' + timezone: '' + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_rendering: true + fallback_handler: search_api_date + fallback_options: + date_format: fallback + custom_date_format: '' + timezone: '' + link_to_item: false + multi_type: separator + multi_separator: ', ' + entity_type: media + plugin_id: search_api_field + search_api_operations: + id: search_api_operations + table: search_api_index_content + field: search_api_operations + relationship: none + group_type: group + admin_label: '' + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + destination: true + plugin_id: search_api_entity_operations + filters: + search_api_fulltext: + id: search_api_fulltext + table: search_api_index_content + field: search_api_fulltext + relationship: none + group_type: group + admin_label: '' + operator: and + value: '' + group: 1 + exposed: true + expose: + operator_id: search_api_fulltext_op + label: 'Fulltext search' + description: '' + use_operator: false + operator: search_api_fulltext_op + identifier: search_api_fulltext + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + editor: '0' + seo: '0' + administrator: '0' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + parse_mode: terms + min_length: 3 + fields: { } + plugin_id: search_api_fulltext + search_api_language: + id: search_api_language + table: search_api_index_content + field: search_api_language + relationship: none + group_type: group + admin_label: '' + operator: in + value: + '***LANGUAGE_language_interface***': '***LANGUAGE_language_interface***' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + plugin_id: search_api_language + search_api_datasource: + id: search_api_datasource + table: search_api_index_content + field: search_api_datasource + relationship: none + group_type: group + admin_label: '' + operator: or + value: + 'entity:media': 'entity:media' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + reduce_duplicates: false + plugin_id: search_api_datasource + sorts: + search_api_relevance: + id: search_api_relevance + table: search_api_index_content + field: search_api_relevance + relationship: none + group_type: group + admin_label: '' + order: ASC + exposed: false + expose: + label: '' + plugin_id: search_api + title: Content + header: + result: + id: result + table: views + field: result + relationship: none + group_type: group + admin_label: '' + empty: false + content: 'Displaying @start - @end of @total' + plugin_id: result + facet_block: + id: facet_block + table: views + field: facet_block + relationship: none + group_type: group + admin_label: '' + empty: false + plugin_id: facet_block + footer: { } + empty: { } + relationships: { } + arguments: { } + display_extenders: { } + use_ajax: false + filter_groups: + operator: AND + groups: + 1: AND + cache_metadata: + max-age: 0 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - user.permissions + tags: + - 'config:field.storage.media.field_expires' + page_1: + display_options: + path: admin/content/media + menu: + type: tab + title: Content + description: '' + expanded: false + parent: '' + weight: 1 + context: '0' + menu_name: admin + tab_options: + type: normal + title: Content + description: 'Find and manage content' + weight: -10 + display_extenders: { } + cache: + type: none + options: { } + defaults: + cache: false + exposed_block: true + display_plugin: page + display_title: Page + id: page_1 + position: 1 + cache_metadata: + max-age: 0 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - user.permissions + tags: + - 'config:field.storage.media.field_expires' From 74bdf5df9b32e8792f687522a00e18555408ef9e Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 16 Nov 2017 15:40:27 +0100 Subject: [PATCH 014/134] WIP --- composer.json | 3 +-- modules/thunder_search/thunder_search.install | 7 ++++++- tests/src/Functional/InstalledConfigurationTest.php | 6 ++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 030db6a66..45ad5d2fd 100644 --- a/composer.json +++ b/composer.json @@ -80,8 +80,7 @@ }, "drupal/search_api": { "Support entity 'operations' in Views": "https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch", - "Facets not shown on view of overridden system route": "https://www.drupal.org/files/issues/2916754-2.patch", - "Don't export database_text in config files": "https://www.drupal.org/files/issues/don_t_export-2921582-2.patch" + "Facets not shown on view of overridden system route": "https://www.drupal.org/files/issues/2916754-2.patch" }, "drupal/views_bulk_operations": { "'Undefined index: entity type' when using vbo with search api based view": "https://www.drupal.org/files/issues/undefined_index_-2921563-2.patch" diff --git a/modules/thunder_search/thunder_search.install b/modules/thunder_search/thunder_search.install index 51726ab13..30855a17c 100644 --- a/modules/thunder_search/thunder_search.install +++ b/modules/thunder_search/thunder_search.install @@ -11,5 +11,10 @@ use Drupal\views\Entity\View; * Implements hook_install(). */ function thunder_search_install() { - View::load('content')->setStatus(FALSE)->save(); + if ($view = View::load('content')) { + $view->setStatus(FALSE)->save(); + } + if ($view = View::load('thunder_media')) { + $view->setStatus(FALSE)->save(); + } } diff --git a/tests/src/Functional/InstalledConfigurationTest.php b/tests/src/Functional/InstalledConfigurationTest.php index 7d5c60729..7d81b502c 100644 --- a/tests/src/Functional/InstalledConfigurationTest.php +++ b/tests/src/Functional/InstalledConfigurationTest.php @@ -171,6 +171,12 @@ class InstalledConfigurationTest extends ThunderBaseTest { ], 'status' => TRUE, ], + 'views.view.thunder_media' => [ + 'dependencies' => [ + 'config' => TRUE, + ], + 'status' => TRUE, + ], 'views.view.content' => [ 'dependencies' => [ 'config' => TRUE, From 87b1690fdc006a1d43c7eb01fd8f1fd0248017f4 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Fri, 24 Nov 2017 08:55:36 +0100 Subject: [PATCH 015/134] WIP --- .../thunder_riddle/thunder_riddle.module | 3 ++- modules/thunder_media/thunder_media.module | 6 +++-- modules/thunder_search/thunder_search.install | 22 +++++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/modules/thunder_article/modules/thunder_riddle/thunder_riddle.module b/modules/thunder_article/modules/thunder_riddle/thunder_riddle.module index e81f9cf37..27f5b310d 100644 --- a/modules/thunder_article/modules/thunder_riddle/thunder_riddle.module +++ b/modules/thunder_article/modules/thunder_riddle/thunder_riddle.module @@ -9,8 +9,9 @@ * Implements hook_menu_local_actions_alter(). */ function thunder_riddle_menu_local_actions_alter(&$local_actions) { + /** @var \Drupal\views\ViewEntityInterface $view */ $view = \Drupal::entityTypeManager()->getStorage('view')->load('thunder_media'); - if ($view) { + if ($view && $view->status()) { $local_actions['riddle_marketplace.import']['appears_on'][] = 'view.thunder_media.media_page_list'; } } diff --git a/modules/thunder_media/thunder_media.module b/modules/thunder_media/thunder_media.module index 25f1ec703..f644d8085 100644 --- a/modules/thunder_media/thunder_media.module +++ b/modules/thunder_media/thunder_media.module @@ -61,8 +61,9 @@ function thunder_media_page_attachments(array &$page) { * Implements hook_menu_local_actions_alter(). */ function thunder_media_menu_local_actions_alter(&$local_actions) { + /** @var \Drupal\views\ViewEntityInterface $view */ $view = \Drupal::entityTypeManager()->getStorage('view')->load('thunder_media'); - if ($view) { + if ($view && $view->status()) { $local_actions['media.add']['appears_on'][] = 'view.thunder_media.media_page_list'; } } @@ -71,8 +72,9 @@ function thunder_media_menu_local_actions_alter(&$local_actions) { * Implements hook_menu_links_discovered_alter(). */ function thunder_media_menu_links_discovered_alter(&$links) { + /** @var \Drupal\views\ViewEntityInterface $view */ $view = \Drupal::entityTypeManager()->getStorage('view')->load('thunder_media'); - if ($view) { + if ($view && $view->status()) { $links['entity.media.collection']['route_name'] = 'view.thunder_media.media_page_list'; } } diff --git a/modules/thunder_search/thunder_search.install b/modules/thunder_search/thunder_search.install index 30855a17c..afcd554f1 100644 --- a/modules/thunder_search/thunder_search.install +++ b/modules/thunder_search/thunder_search.install @@ -18,3 +18,25 @@ function thunder_search_install() { $view->setStatus(FALSE)->save(); } } + +/** + * Implements hook_menu_local_actions_alter(). + */ +function thunder_search_menu_local_actions_alter(&$local_actions) { + /** @var \Drupal\views\ViewEntityInterface $view */ + $view = \Drupal::entityTypeManager()->getStorage('view')->load('media_search'); + if ($view && $view->status()) { + $local_actions['media.add']['appears_on'][] = 'view.media_search.page_1'; + } +} + +/** + * Implements hook_menu_links_discovered_alter(). + */ +function thunder_search_menu_links_discovered_alter(&$links) { + /** @var \Drupal\views\ViewEntityInterface $view */ + $view = \Drupal::entityTypeManager()->getStorage('view')->load('media_search'); + if ($view && $view->status()) { + $links['entity.media.collection']['route_name'] = 'view.media_search.page_1'; + } +} From 859bba8be21c1023b411bdb9724ea45790f5fa23 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 30 Nov 2017 12:57:08 +0100 Subject: [PATCH 016/134] WIP --- modules/thunder_search/thunder_search.install | 22 ------------------- modules/thunder_search/thunder_search.module | 22 +++++++++++++++++++ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/modules/thunder_search/thunder_search.install b/modules/thunder_search/thunder_search.install index afcd554f1..30855a17c 100644 --- a/modules/thunder_search/thunder_search.install +++ b/modules/thunder_search/thunder_search.install @@ -18,25 +18,3 @@ function thunder_search_install() { $view->setStatus(FALSE)->save(); } } - -/** - * Implements hook_menu_local_actions_alter(). - */ -function thunder_search_menu_local_actions_alter(&$local_actions) { - /** @var \Drupal\views\ViewEntityInterface $view */ - $view = \Drupal::entityTypeManager()->getStorage('view')->load('media_search'); - if ($view && $view->status()) { - $local_actions['media.add']['appears_on'][] = 'view.media_search.page_1'; - } -} - -/** - * Implements hook_menu_links_discovered_alter(). - */ -function thunder_search_menu_links_discovered_alter(&$links) { - /** @var \Drupal\views\ViewEntityInterface $view */ - $view = \Drupal::entityTypeManager()->getStorage('view')->load('media_search'); - if ($view && $view->status()) { - $links['entity.media.collection']['route_name'] = 'view.media_search.page_1'; - } -} diff --git a/modules/thunder_search/thunder_search.module b/modules/thunder_search/thunder_search.module index 888d51f7f..88bf418f5 100644 --- a/modules/thunder_search/thunder_search.module +++ b/modules/thunder_search/thunder_search.module @@ -18,3 +18,25 @@ function thunder_search_views_data() { ]; return $data; } + +/** + * Implements hook_menu_local_actions_alter(). + */ +function thunder_search_menu_local_actions_alter(&$local_actions) { + /** @var \Drupal\views\ViewEntityInterface $view */ + $view = \Drupal::entityTypeManager()->getStorage('view')->load('media_search'); + if ($view && $view->status()) { + $local_actions['media.add']['appears_on'][] = 'view.media_search.page_1'; + } +} + +/** + * Implements hook_menu_links_discovered_alter(). + */ +function thunder_search_menu_links_discovered_alter(&$links) { + /** @var \Drupal\views\ViewEntityInterface $view */ + $view = \Drupal::entityTypeManager()->getStorage('view')->load('media_search'); + if ($view && $view->status()) { + $links['entity.media.collection']['route_name'] = 'view.media_search.page_1'; + } +} From 12f2876444b121a7dcff27eed11eb657af835c2b Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 5 Dec 2017 10:30:53 +0100 Subject: [PATCH 017/134] Stable versions --- composer.json | 7 ++----- drupal-org.make | 6 ++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 45ad5d2fd..d568ca4c5 100644 --- a/composer.json +++ b/composer.json @@ -81,9 +81,6 @@ "drupal/search_api": { "Support entity 'operations' in Views": "https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch", "Facets not shown on view of overridden system route": "https://www.drupal.org/files/issues/2916754-2.patch" - }, - "drupal/views_bulk_operations": { - "'Undefined index: entity type' when using vbo with search api based view": "https://www.drupal.org/files/issues/undefined_index_-2921563-2.patch" } } }, @@ -115,7 +112,7 @@ "drupal/entity_browser": "1.3", "drupal/entity_reference_revisions": "^1.0", "drupal/fb_instant_articles": "dev-1.x", - "drupal/facets": "dev-1.x", + "drupal/facets": "^1.0", "drupal/field_group": "^1.0", "drupal/focal_point": "^1.0", "drupal/google_analytics": "^2.0", @@ -146,7 +143,7 @@ "drupal/thunder_admin": ">=1", "drupal/token": "^1.0", "drupal/video_embed_field": "^1.0", - "drupal/views_bulk_operations": "1.0-beta2", + "drupal/views_bulk_operations": "^1.0", "drupal/views_load_more": "dev-1.x", "valiton/harbourmaster": "~8.1", "bower-asset/dropzone": "^5.1", diff --git a/drupal-org.make b/drupal-org.make index c6cb2c392..ad4203d08 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -45,8 +45,7 @@ projects[entity_browser][patch][] = https://www.drupal.org/files/issues/2858438_ projects[entity_reference_revisions][type] = module projects[entity_reference_revisions][version] = 1 projects[facets][type] = module -projects[facets][download][url] = http://git.drupal.org/project/facets.git -projects[facets][download][branch] = 8.x-1.x +projects[facets][version] = 1 projects[fb_instant_articles][type] = module projects[fb_instant_articles][download][url] = http://git.drupal.org/project/fb_instant_articles.git projects[fb_instant_articles][download][branch] = 8.x-1.x @@ -128,8 +127,7 @@ projects[infinite][type] = theme projects[infinite][download][url] = http://git.drupal.org/sandbox/gos77/2677750.git projects[infinite][download][tag] = 8.x-1.0-beta7 projects[views_bulk_operations][type] = module -projects[views_bulk_operations][version] = 1.0-beta2 -projects[views_bulk_operations][patch][] = https://www.drupal.org/files/issues/undefined_index_-2921563-2.patch +projects[views_bulk_operations][version] = 1 projects[video_embed_field][type] = module projects[video_embed_field][version] = 1 projects[views_load_more][type] = module From f7d9c6ad8b1408eac4a4e9c26da6e9c0f4705351 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 5 Dec 2017 14:28:11 +0100 Subject: [PATCH 018/134] Finalize content search --- .../facets.facet.promoted_to_front_page.yml | 2 +- .../config/optional/facets.facet.status.yml | 7 +- .../facets.facet.sticky_at_top_of_lists.yml | 2 +- .../optional/search_api.index.content.yml | 45 ++--- .../optional/views.view.content_search.yml | 156 +++++++++++++++--- 5 files changed, 158 insertions(+), 54 deletions(-) diff --git a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml index 966f8a50f..aabe7abae 100644 --- a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml +++ b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml @@ -7,7 +7,7 @@ dependencies: module: - search_api id: promoted_to_front_page -name: 'Promoted to front page' +name: Promoted url_alias: promoted_to_front_page weight: 0 min_count: 1 diff --git a/modules/thunder_search/config/optional/facets.facet.status.yml b/modules/thunder_search/config/optional/facets.facet.status.yml index bb277fd8e..70774b19c 100644 --- a/modules/thunder_search/config/optional/facets.facet.status.yml +++ b/modules/thunder_search/config/optional/facets.facet.status.yml @@ -7,7 +7,7 @@ dependencies: module: - search_api id: status -name: status +name: Status url_alias: status weight: 0 min_count: 1 @@ -57,11 +57,6 @@ processor_configs: weights: build: -10 settings: { } - list_item: - processor_id: list_item - weights: - build: 5 - settings: { } url_processor_handler: processor_id: url_processor_handler weights: diff --git a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml index c6ffd297a..b866c7d24 100644 --- a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml +++ b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml @@ -7,7 +7,7 @@ dependencies: module: - search_api id: sticky_at_top_of_lists -name: 'Sticky at top of lists' +name: Sticky url_alias: sticky_at_top_of_lists weight: 0 min_count: 1 diff --git a/modules/thunder_search/config/optional/search_api.index.content.yml b/modules/thunder_search/config/optional/search_api.index.content.yml index de643f954..d45908fd0 100644 --- a/modules/thunder_search/config/optional/search_api.index.content.yml +++ b/modules/thunder_search/config/optional/search_api.index.content.yml @@ -64,26 +64,6 @@ field_settings: - 'entity:node/type' - 'entity:media/bundle' - 'entity:taxonomy_term/vid' - changed: - label: Changed - property_path: aggregated_field - type: date - configuration: - type: union - fields: - - 'entity:node/changed' - - 'entity:media/changed' - - 'entity:taxonomy_term/changed' - published: - label: Published - property_path: aggregated_field - type: boolean - configuration: - type: union - fields: - - 'entity:node/status' - - 'entity:media/status' - - 'entity:taxonomy_term/status' status: label: status datasource_id: 'entity:node' @@ -124,6 +104,31 @@ field_settings: dependencies: config: - field.storage.node.field_channel + node_changed: + label: Changed + datasource_id: 'entity:node' + property_path: changed + type: date + media_changed: + label: Changed + datasource_id: 'entity:media' + property_path: changed + type: date + media_status: + label: 'Publishing status' + datasource_id: 'entity:media' + property_path: status + type: boolean + term_changed: + label: Changed + datasource_id: 'entity:taxonomy_term' + property_path: changed + type: date + term_status: + label: Published + datasource_id: 'entity:taxonomy_term' + property_path: status + type: boolean datasource_settings: 'entity:node': bundles: diff --git a/modules/thunder_search/config/optional/views.view.content_search.yml b/modules/thunder_search/config/optional/views.view.content_search.yml index 82bbaeebd..876151afa 100644 --- a/modules/thunder_search/config/optional/views.view.content_search.yml +++ b/modules/thunder_search/config/optional/views.view.content_search.yml @@ -2,6 +2,7 @@ langcode: en status: true dependencies: config: + - field.storage.node.field_channel - field.storage.node.field_teaser_media - image.style.thumbnail - search_api.index.content @@ -88,7 +89,7 @@ display: field_channel: field_channel status: status publish_on: publish_on - changed_1: changed_1 + node_changed: node_changed search_api_operations: search_api_operations info: views_bulk_operations_bulk_form: @@ -100,7 +101,7 @@ display: align: '' separator: '' empty_column: false - responsive: '' + responsive: priority-low label: sortable: true default_sort_order: asc @@ -114,35 +115,39 @@ display: align: '' separator: '' empty_column: false - responsive: '' + responsive: priority-medium field_channel: + sortable: false + default_sort_order: asc align: '' separator: '' empty_column: false - responsive: '' + responsive: priority-low status: + sortable: true + default_sort_order: asc align: '' separator: '' empty_column: false - responsive: '' + responsive: priority-medium publish_on: align: '' separator: '' empty_column: false - responsive: '' - changed_1: + responsive: priority-low + node_changed: sortable: true default_sort_order: desc align: '' separator: '' empty_column: false - responsive: '' + responsive: priority-low search_api_operations: align: '' separator: '' empty_column: false responsive: '' - default: changed_1 + default: node_changed empty_table: false row: type: fields @@ -431,14 +436,14 @@ display: multi_type: separator multi_separator: ', ' plugin_id: search_api - published: - id: published + field_channel: + id: field_channel table: search_api_index_content - field: published + field: field_channel relationship: none group_type: group admin_label: '' - label: Published + label: Channel exclude: false alter: alter_text: false @@ -479,10 +484,109 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - link_to_item: false + click_sort_column: target_id + type: entity_reference_label + settings: + link: true + group_column: target_id + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false multi_type: separator - multi_separator: ', ' - plugin_id: search_api + separator: ', ' + field_api_classes: false + field_rendering: true + fallback_handler: search_api_entity + fallback_options: + link_to_item: false + multi_type: separator + multi_separator: ', ' + display_methods: + channel: + display_method: label + view_mode: default + tags: + display_method: label + view_mode: default + plugin_id: search_api_field + status: + id: status + table: search_api_index_content + field: status + relationship: none + group_type: group + admin_label: '' + label: Status + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: boolean + settings: + format: custom + format_custom_true: Published + format_custom_false: Unpublished + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_rendering: true + fallback_handler: search_api_boolean + fallback_options: + type: yes-no + type_custom_true: '' + type_custom_false: '' + not: false + link_to_item: false + multi_type: separator + multi_separator: ', ' + plugin_id: search_api_field publish_on: id: publish_on table: search_api_datasource_content_entity_node @@ -555,17 +659,17 @@ display: multi_separator: ', ' entity_type: node plugin_id: search_api_field - changed_1: - id: changed_1 + node_changed: + id: node_changed table: search_api_index_content - field: changed + field: node_changed relationship: none group_type: group admin_label: '' - label: Updated + label: 'Changed ' exclude: false alter: - alter_text: true + alter_text: false text: '' make_link: false path: '' @@ -595,7 +699,7 @@ display: element_class: '' element_label_type: '' element_label_class: '' - element_label_colon: false + element_label_colon: true element_wrapper_type: '' element_wrapper_class: '' element_default_classes: true @@ -603,9 +707,6 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - link_to_item: 0 - multi_type: separator - multi_separator: ', ' click_sort_column: value type: timestamp settings: @@ -619,6 +720,7 @@ display: delta_offset: 0 delta_reversed: false delta_first_last: false + multi_type: separator separator: ', ' field_api_classes: false field_rendering: true @@ -638,7 +740,7 @@ display: relationship: none group_type: group admin_label: '' - label: '' + label: Operations exclude: false alter: alter_text: false @@ -855,6 +957,7 @@ display: - url.query_args - user.permissions tags: + - 'config:field.storage.node.field_channel' - 'config:field.storage.node.field_teaser_media' page_1: display_options: @@ -892,4 +995,5 @@ display: - url.query_args - user.permissions tags: + - 'config:field.storage.node.field_channel' - 'config:field.storage.node.field_teaser_media' From 716f951c77286202747bae10314e3e80350080d6 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 6 Dec 2017 12:34:12 +0100 Subject: [PATCH 019/134] Update media view --- .../optional/search_api.index.content.yml | 20 ++++---- .../optional/views.view.media_search.yml | 49 ++++++++++--------- 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/modules/thunder_search/config/optional/search_api.index.content.yml b/modules/thunder_search/config/optional/search_api.index.content.yml index d45908fd0..d02c001be 100644 --- a/modules/thunder_search/config/optional/search_api.index.content.yml +++ b/modules/thunder_search/config/optional/search_api.index.content.yml @@ -119,6 +119,14 @@ field_settings: datasource_id: 'entity:media' property_path: status type: boolean + media_author: + label: 'Publisher ID » User » Name' + datasource_id: 'entity:media' + property_path: 'uid:entity:name' + type: string + dependencies: + module: + - user term_changed: label: Changed datasource_id: 'entity:taxonomy_term' @@ -164,6 +172,7 @@ processor_settings: - label - type - name + - media_author title: true alt: true tags: @@ -184,6 +193,7 @@ processor_settings: - label - type - name + - media_author weights: preprocess_index: -20 preprocess_query: -20 @@ -249,13 +259,3 @@ processor_settings: - rendered_item - label - type - - name - weights: - preprocess_index: -20 - preprocess_query: -20 -tracker_settings: - default: { } -options: - index_directly: true - cron_limit: 50 -server: database diff --git a/modules/thunder_search/config/optional/views.view.media_search.yml b/modules/thunder_search/config/optional/views.view.media_search.yml index 32494b27c..d426e66d9 100644 --- a/modules/thunder_search/config/optional/views.view.media_search.yml +++ b/modules/thunder_search/config/optional/views.view.media_search.yml @@ -86,9 +86,9 @@ display: thumbnail: thumbnail label: label type: type - status: status + media_status: media_status field_expires: field_expires - changed: changed + media_changed: media_changed search_api_operations: search_api_operations info: views_bulk_operations_bulk_form: @@ -107,35 +107,39 @@ display: align: '' separator: '' empty_column: false - responsive: '' + responsive: priority-medium type: sortable: true default_sort_order: asc align: '' separator: '' empty_column: false - responsive: '' - status: + responsive: priority-medium + media_status: + sortable: true + default_sort_order: asc align: '' separator: '' empty_column: false - responsive: '' + responsive: priority-medium field_expires: align: '' separator: '' empty_column: false - responsive: '' - changed: + responsive: priority-low + media_changed: + sortable: true + default_sort_order: desc align: '' separator: '' empty_column: false - responsive: '' + responsive: priority-low search_api_operations: align: '' separator: '' empty_column: false responsive: '' - default: '-1' + default: media_changed empty_table: false row: type: fields @@ -405,10 +409,10 @@ display: multi_type: separator multi_separator: ', ' plugin_id: search_api - status: - id: status - table: search_api_datasource_content_entity_media - field: status + media_status: + id: media_status + table: search_api_index_content + field: media_status relationship: none group_type: group admin_label: '' @@ -479,7 +483,6 @@ display: link_to_item: false multi_type: separator multi_separator: ', ' - entity_type: media plugin_id: search_api_field field_expires: id: field_expires @@ -552,10 +555,10 @@ display: multi_separator: ', ' entity_type: media plugin_id: search_api_field - changed: - id: changed - table: search_api_datasource_content_entity_media - field: changed + media_changed: + id: media_changed + table: search_api_index_content + field: media_changed relationship: none group_type: group admin_label: '' @@ -625,7 +628,6 @@ display: link_to_item: false multi_type: separator multi_separator: ', ' - entity_type: media plugin_id: search_api_field search_api_operations: id: search_api_operations @@ -634,7 +636,7 @@ display: relationship: none group_type: group admin_label: '' - label: '' + label: Operations exclude: false alter: alter_text: false @@ -811,7 +813,7 @@ display: expose: label: '' plugin_id: search_api - title: Content + title: Media header: result: id: result @@ -857,7 +859,7 @@ display: path: admin/content/media menu: type: tab - title: Content + title: Media description: '' expanded: false parent: '' @@ -872,7 +874,6 @@ display: display_extenders: { } cache: type: none - options: { } defaults: cache: false exposed_block: true From 7f235a81ce89a5ca6ed8d5d9dd1eb8e7850de1e4 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 6 Dec 2017 16:12:33 +0100 Subject: [PATCH 020/134] Add media facets --- .../optional/facets.facet.media_status.yml | 68 +++++++++++++++++++ .../optional/facets.facet.media_type.yml | 65 ++++++++++++++++++ .../facets.facet.publishing_status.yml | 67 ++++++++++++++++++ .../optional/views.view.media_search.yml | 49 ++++++------- 4 files changed, 219 insertions(+), 30 deletions(-) create mode 100644 modules/thunder_search/config/optional/facets.facet.media_status.yml create mode 100644 modules/thunder_search/config/optional/facets.facet.media_type.yml create mode 100644 modules/thunder_search/config/optional/facets.facet.publishing_status.yml diff --git a/modules/thunder_search/config/optional/facets.facet.media_status.yml b/modules/thunder_search/config/optional/facets.facet.media_status.yml new file mode 100644 index 000000000..526ee08e8 --- /dev/null +++ b/modules/thunder_search/config/optional/facets.facet.media_status.yml @@ -0,0 +1,68 @@ +uuid: f574126d-d88b-4b49-9f64-9d50e5cf37c8 +langcode: en +status: true +dependencies: + config: + - search_api.index.content + - views.view.media_search + module: + - search_api +id: media_status +name: 'Publishing status' +url_alias: media_status +weight: 0 +min_count: 1 +show_only_one_result: true +field_identifier: media_status +facet_source_id: 'search_api:views_page__media_search__page_1' +widget: + type: dropdown + config: + show_numbers: false + default_option_label: Choose +query_operator: or +use_hierarchy: false +expand_hierarchy: false +enable_parent_when_child_gets_disabled: true +hard_limit: 0 +exclude: false +only_visible_when_facet_source_is_visible: true +processor_configs: + active_widget_order: + processor_id: active_widget_order + weights: + sort: -10 + settings: + sort: DESC + boolean_item: + processor_id: boolean_item + weights: + build: -10 + settings: + on_value: Published + off_value: Unpublished + count_widget_order: + processor_id: count_widget_order + weights: + sort: -10 + settings: + sort: DESC + display_value_widget_order: + processor_id: display_value_widget_order + weights: + sort: -10 + settings: + sort: ASC + hide_non_narrowing_result_processor: + processor_id: hide_non_narrowing_result_processor + weights: + build: -10 + settings: { } + url_processor_handler: + processor_id: url_processor_handler + weights: + pre_query: -10 + build: -10 + settings: { } +empty_behavior: + behavior: none diff --git a/modules/thunder_search/config/optional/facets.facet.media_type.yml b/modules/thunder_search/config/optional/facets.facet.media_type.yml new file mode 100644 index 000000000..36a8fc9e1 --- /dev/null +++ b/modules/thunder_search/config/optional/facets.facet.media_type.yml @@ -0,0 +1,65 @@ +langcode: en +status: true +dependencies: + config: + - search_api.index.content + - views.view.media_search + module: + - search_api +id: media_type +name: Type +url_alias: media_type +weight: 0 +min_count: 1 +show_only_one_result: true +field_identifier: type +facet_source_id: 'search_api:views_page__media_search__page_1' +widget: + type: dropdown + config: + show_numbers: false + default_option_label: Choose +query_operator: or +use_hierarchy: false +expand_hierarchy: false +enable_parent_when_child_gets_disabled: true +hard_limit: 0 +exclude: false +only_visible_when_facet_source_is_visible: true +processor_configs: + active_widget_order: + processor_id: active_widget_order + weights: + sort: -10 + settings: + sort: DESC + count_widget_order: + processor_id: count_widget_order + weights: + sort: -10 + settings: + sort: DESC + display_value_widget_order: + processor_id: display_value_widget_order + weights: + sort: -10 + settings: + sort: ASC + hide_1_result_facet: + processor_id: hide_1_result_facet + weights: + build: -10 + settings: { } + hide_non_narrowing_result_processor: + processor_id: hide_non_narrowing_result_processor + weights: + build: -10 + settings: { } + url_processor_handler: + processor_id: url_processor_handler + weights: + pre_query: -10 + build: -10 + settings: { } +empty_behavior: + behavior: none diff --git a/modules/thunder_search/config/optional/facets.facet.publishing_status.yml b/modules/thunder_search/config/optional/facets.facet.publishing_status.yml new file mode 100644 index 000000000..17dd8daab --- /dev/null +++ b/modules/thunder_search/config/optional/facets.facet.publishing_status.yml @@ -0,0 +1,67 @@ +langcode: en +status: true +dependencies: + config: + - search_api.index.content + - views.view.media_search + module: + - search_api +id: publishing_status +name: Status +url_alias: publishing_status +weight: 0 +min_count: 1 +show_only_one_result: true +field_identifier: media_status +facet_source_id: 'search_api:views_page__media_search__page_1' +widget: + type: dropdown + config: + show_numbers: false + default_option_label: Choose +query_operator: or +use_hierarchy: false +expand_hierarchy: false +enable_parent_when_child_gets_disabled: true +hard_limit: 0 +exclude: false +only_visible_when_facet_source_is_visible: true +processor_configs: + active_widget_order: + processor_id: active_widget_order + weights: + sort: -10 + settings: + sort: DESC + boolean_item: + processor_id: boolean_item + weights: + build: -10 + settings: + on_value: Published + off_value: Unpublished + count_widget_order: + processor_id: count_widget_order + weights: + sort: -10 + settings: + sort: DESC + display_value_widget_order: + processor_id: display_value_widget_order + weights: + sort: -10 + settings: + sort: ASC + hide_non_narrowing_result_processor: + processor_id: hide_non_narrowing_result_processor + weights: + build: -10 + settings: { } + url_processor_handler: + processor_id: url_processor_handler + weights: + pre_query: -10 + build: -10 + settings: { } +empty_behavior: + behavior: none diff --git a/modules/thunder_search/config/optional/views.view.media_search.yml b/modules/thunder_search/config/optional/views.view.media_search.yml index d426e66d9..66d1f4b8c 100644 --- a/modules/thunder_search/config/optional/views.view.media_search.yml +++ b/modules/thunder_search/config/optional/views.view.media_search.yml @@ -195,43 +195,32 @@ display: batch: true batch_size: 10 form_step: true + buttons: false action_title: Action selected_actions: - media_delete_action: 0 - media_publish_action: 0 - media_save_action: 0 - media_unpublish_action: 0 - node_assign_owner_action: node_assign_owner_action - node_unpromote_action: node_unpromote_action - node_promote_action: node_promote_action - node_publish_action: node_publish_action - node_save_action: node_save_action - node_make_sticky_action: node_make_sticky_action - node_unpublish_by_keyword_action: node_unpublish_by_keyword_action - node_unpublish_action: node_unpublish_action - node_make_unsticky_action: node_make_unsticky_action - views_bulk_operations_delete_entity: views_bulk_operations_delete_entity + media_delete_action: media_delete_action + media_publish_action: media_publish_action + media_save_action: media_save_action + media_unpublish_action: media_unpublish_action + node_assign_owner_action: 0 + node_unpromote_action: 0 + node_promote_action: 0 + node_publish_action: 0 + node_save_action: 0 + node_make_sticky_action: 0 + node_unpublish_by_keyword_action: 0 + node_unpublish_action: 0 + node_make_unsticky_action: 0 + views_bulk_operations_delete_entity: 0 pathauto_update_alias: 0 preconfiguration: - node_assign_owner_action: + media_delete_action: label_override: '' - node_unpromote_action: + media_publish_action: label_override: '' - node_promote_action: + media_save_action: label_override: '' - node_publish_action: - label_override: '' - node_save_action: - label_override: '' - node_make_sticky_action: - label_override: '' - node_unpublish_by_keyword_action: - label_override: '' - node_unpublish_action: - label_override: '' - node_make_unsticky_action: - label_override: '' - views_bulk_operations_delete_entity: + media_unpublish_action: label_override: '' plugin_id: views_bulk_operations_bulk_form thumbnail: From 917b2d009e3e1ada8173e42bfa035ed2948045db Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 7 Dec 2017 15:04:50 +0100 Subject: [PATCH 021/134] Use search api in entity browser --- composer.json | 4 +- drupal-org.make | 2 + modules/thunder_media/thunder_media.module | 1 + .../optional/views.view.entity_browser.yml | 527 ++++++++++++++++++ 4 files changed, 533 insertions(+), 1 deletion(-) create mode 100644 modules/thunder_search/config/optional/views.view.entity_browser.yml diff --git a/composer.json b/composer.json index d568ca4c5..2b8fd9bb5 100644 --- a/composer.json +++ b/composer.json @@ -73,7 +73,9 @@ "Don't use network for loading logo information": "https://www.drupal.org/files/issues/amptheme-do_not_use_the_network_for_loading_logo_information-2753089-7.patch" }, "drupal/entity_browser": { - "Provide inline entity form FieldWidgetDisplay": "https://www.drupal.org/files/issues/2858438_6.patch" + "Provide inline entity form FieldWidgetDisplay": "https://www.drupal.org/files/issues/2858438_6.patch", + "The View widget should filter based on field settings": "https://www.drupal.org/files/issues/entity-browser-view-context-2865928-14.patch", + "Integration with search API based views": "https://www.drupal.org/files/issues/2915746-2.patch" }, "drupal/media_entity_pinterest": { "Media name always 'h'": "https://www.drupal.org/files/issues/media_name_always_h-2837977-8.patch" diff --git a/drupal-org.make b/drupal-org.make index ad4203d08..cb5b4a264 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -42,6 +42,8 @@ projects[entity][version] = 1 projects[entity_browser][type] = module projects[entity_browser][version] = 1.3 projects[entity_browser][patch][] = https://www.drupal.org/files/issues/2858438_6.patch +projects[entity_browser][patch][] = https://www.drupal.org/files/issues/entity-browser-view-context-2865928-14.patch +projects[entity_browser][patch][] = https://www.drupal.org/files/issues/2915746-2.patch projects[entity_reference_revisions][type] = module projects[entity_reference_revisions][version] = 1 projects[facets][type] = module diff --git a/modules/thunder_media/thunder_media.module b/modules/thunder_media/thunder_media.module index f644d8085..a23131c49 100644 --- a/modules/thunder_media/thunder_media.module +++ b/modules/thunder_media/thunder_media.module @@ -36,6 +36,7 @@ function thunder_media_file_create(File $entity) { function thunder_media_preprocess_views_view(&$variables) { $thunder_media_browser = [ + 'entity_browser', 'image_browser', 'video_browser', 'riddle_browser', diff --git a/modules/thunder_search/config/optional/views.view.entity_browser.yml b/modules/thunder_search/config/optional/views.view.entity_browser.yml new file mode 100644 index 000000000..f22138af6 --- /dev/null +++ b/modules/thunder_search/config/optional/views.view.entity_browser.yml @@ -0,0 +1,527 @@ +langcode: en +status: true +dependencies: + config: + - image.style.entity_browser_thumbnail + - search_api.index.content + module: + - entity_browser + - image + - search_api + - thunder_search + - user +id: entity_browser +label: entity_browser +module: views +description: '' +tag: '' +base_table: search_api_index_content +base_field: search_api_id +core: 8.x +display: + default: + display_plugin: default + id: default + display_title: Master + position: 0 + display_options: + access: + type: perm + options: + perm: 'access content overview' + cache: + type: none + options: { } + query: + type: search_api_query + options: + bypass_access: false + skip_access: false + exposed_form: + type: basic + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + pager: + type: full + options: + items_per_page: 50 + offset: 0 + id: 0 + total_pages: null + tags: + previous: ‹‹ + next: ›› + first: '« First' + last: 'Last »' + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + quantity: 9 + style: + type: default + options: + grouping: { } + row_class: '' + default_row_class: true + row: + type: fields + fields: + thumbnail: + id: thumbnail + table: search_api_datasource_content_entity_media + field: thumbnail + relationship: none + group_type: group + admin_label: '' + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: target_id + type: image + settings: + image_style: entity_browser_thumbnail + image_link: '' + group_column: '' + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_rendering: true + fallback_handler: search_api + fallback_options: + link_to_item: false + multi_type: separator + multi_separator: ', ' + entity_type: media + plugin_id: search_api_field + name: + id: name + table: search_api_index_content + field: label + relationship: none + group_type: group + admin_label: '' + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '0' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + link_to_item: false + multi_type: separator + multi_separator: ', ' + plugin_id: search_api + type: + id: type + table: search_api_index_content + field: type + relationship: none + group_type: group + admin_label: '' + label: '' + exclude: true + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + link_to_item: false + multi_type: separator + multi_separator: ', ' + plugin_id: search_api + entity_browser_select: + id: entity_browser_select + table: search_api_index_content + field: entity_browser_select + relationship: none + group_type: group + admin_label: '' + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + plugin_id: entity_browser_search_api_select + filters: + search_api_fulltext: + id: search_api_fulltext + table: search_api_index_content + field: search_api_fulltext + relationship: none + group_type: group + admin_label: '' + operator: and + value: '' + group: 1 + exposed: true + expose: + operator_id: search_api_fulltext_op + label: 'Fulltext search' + description: '' + use_operator: false + operator: search_api_fulltext_op + identifier: search_api_fulltext + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + editor: '0' + seo: '0' + administrator: '0' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + parse_mode: terms + min_length: 3 + fields: { } + plugin_id: search_api_fulltext + search_api_language: + id: search_api_language + table: search_api_index_content + field: search_api_language + relationship: none + group_type: group + admin_label: '' + operator: in + value: + '***LANGUAGE_language_interface***': '***LANGUAGE_language_interface***' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + plugin_id: search_api_language + search_api_datasource: + id: search_api_datasource + table: search_api_index_content + field: search_api_datasource + relationship: none + group_type: group + admin_label: '' + operator: or + value: + 'entity:media': 'entity:media' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + reduce_duplicates: false + plugin_id: search_api_datasource + sorts: + search_api_relevance: + id: search_api_relevance + table: search_api_index_content + field: search_api_relevance + relationship: none + group_type: group + admin_label: '' + order: ASC + exposed: false + expose: + label: '' + plugin_id: search_api + title: Media + header: + result: + id: result + table: views + field: result + relationship: none + group_type: group + admin_label: '' + empty: false + content: 'Displaying @start - @end of @total' + plugin_id: result + facet_block: + id: facet_block + table: views + field: facet_block + relationship: none + group_type: group + admin_label: '' + empty: false + plugin_id: facet_block + footer: { } + empty: { } + relationships: { } + arguments: + type: + id: type + table: search_api_index_content + field: type + relationship: none + group_type: group + admin_label: '' + default_action: default + exception: + value: all + title_enable: false + title: All + title_enable: false + title: '' + default_argument_type: entity_browser_widget_context + default_argument_options: + context_key: target_bundles + fallback: all + multiple: or + default_argument_skip_url: false + summary_options: { } + summary: + sort_order: asc + number_of_records: 0 + format: default_summary + specify_validation: false + validate: + type: none + fail: 'not found' + validate_options: { } + break_phrase: false + not: false + plugin_id: search_api + display_extenders: { } + use_ajax: false + filter_groups: + operator: AND + groups: + 1: AND + css_class: view-media-entity-browser + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - user.permissions + tags: { } + entity_browser_1: + display_plugin: entity_browser + id: entity_browser_1 + display_title: 'Entity browser' + position: 2 + display_options: + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - user.permissions + tags: { } From 2f6138bcd5318db04b4115b7786158e8583417ad Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Mon, 19 Feb 2018 16:17:20 +0100 Subject: [PATCH 022/134] Update modules and patches --- composer.json | 10 +++------- drupal-org.make | 6 ++---- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index da89d3b8c..44159dfa2 100644 --- a/composer.json +++ b/composer.json @@ -73,21 +73,17 @@ "Don't use network for loading logo information": "https://www.drupal.org/files/issues/amptheme-do_not_use_the_network_for_loading_logo_information-2753089-7.patch" }, "drupal/entity_browser": { - "Provide inline entity form FieldWidgetDisplay": "https://www.drupal.org/files/issues/2858438_6.patch", - "The View widget should filter based on field settings": "https://www.drupal.org/files/issues/entity-browser-view-context-2865928-14.patch", - "Integration with search API based views": "https://www.drupal.org/files/issues/2915746-2.patch" + "Integrate editorial search with Search API module": "https://www.drupal.org/files/issues/2899254-combined.patch" }, "drupal/core": { "Setting a revision ID on a new entity sets the newRevision flag to false": "https://www.drupal.org/files/issues/revision-id-unset-2934517-2.patch" }, "drupal/search_api": { - "Support entity 'operations' in Views": "https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch", - "Facets not shown on view of overridden system route": "https://www.drupal.org/files/issues/2916754-2.patch" + "Support entity 'operations' in Views": "https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch" }, "drupal/redirect": { "Provided config does not match the config after an export": "https://www.drupal.org/files/issues/2932248.patch" } - } }, "require": { @@ -143,7 +139,7 @@ "drupal/redirect": "1.0", "drupal/riddle_marketplace": "^2.0", "drupal/scheduler": "^1.0", - "drupal/search_api": "1.5", + "drupal/search_api": "1.6", "drupal/simple_sitemap": "^2.0", "drupal/shariff": "^1.0", "drupal/slick": "^1.0", diff --git a/drupal-org.make b/drupal-org.make index a5e534793..a23b3f602 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -102,10 +102,8 @@ projects[redirect][type] = module projects[redirect][version] = 1.0 projects[redirect][patch][] = https://www.drupal.org/files/issues/2932248.patch projects[search_api][type] = module -projects[search_api][version] = 1.5 -projects[search_api][patch][] = https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch -projects[search_api][patch][] = https://www.drupal.org/files/issues/2916754-2.patch -projects[search_api][patch][] = https://www.drupal.org/files/issues/don_t_export-2921582-2.patch +projects[search_api][version] = 1.6 +projects[search_api][patch][] = https://www.drupal.org/files/issues/2899254-combined.patch projects[scheduler][type] = module projects[scheduler][version] = 1 projects[shariff][type] = module From a3386b798356ddffa7a11547e021a0930a588a46 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Mon, 19 Feb 2018 16:19:13 +0100 Subject: [PATCH 023/134] Fix makefile --- drupal-org.make | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drupal-org.make b/drupal-org.make index a23b3f602..b150eb116 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -41,9 +41,7 @@ projects[entity][type] = module projects[entity][version] = 1 projects[entity_browser][type] = module projects[entity_browser][version] = 1.4 -projects[entity_browser][patch][] = https://www.drupal.org/files/issues/2858438_6.patch -projects[entity_browser][patch][] = https://www.drupal.org/files/issues/entity-browser-view-context-2865928-14.patch -projects[entity_browser][patch][] = https://www.drupal.org/files/issues/2915746-2.patch +projects[entity_browser][patch][] = https://www.drupal.org/files/issues/2899254-combined.patch projects[entity_reference_revisions][type] = module projects[entity_reference_revisions][version] = 1 projects[facets][type] = module @@ -103,7 +101,7 @@ projects[redirect][version] = 1.0 projects[redirect][patch][] = https://www.drupal.org/files/issues/2932248.patch projects[search_api][type] = module projects[search_api][version] = 1.6 -projects[search_api][patch][] = https://www.drupal.org/files/issues/2899254-combined.patch +projects[search_api][patch][] = https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch projects[scheduler][type] = module projects[scheduler][version] = 1 projects[shariff][type] = module From 081b6eb475db0242089bdaba248e34ccbc4b160b Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 20 Feb 2018 11:31:53 +0100 Subject: [PATCH 024/134] Add missing configs --- .../optional/search_api.index.content.yml | 9 +++++++++ modules/thunder_search/thunder_search.install | 20 ------------------- thunder.profile | 1 + 3 files changed, 10 insertions(+), 20 deletions(-) delete mode 100644 modules/thunder_search/thunder_search.install diff --git a/modules/thunder_search/config/optional/search_api.index.content.yml b/modules/thunder_search/config/optional/search_api.index.content.yml index d02c001be..fc8706583 100644 --- a/modules/thunder_search/config/optional/search_api.index.content.yml +++ b/modules/thunder_search/config/optional/search_api.index.content.yml @@ -259,3 +259,12 @@ processor_settings: - rendered_item - label - type + - name + - media_author +tracker_settings: + default: + indexing_order: fifo +options: + index_directly: true + cron_limit: 50 +server: database diff --git a/modules/thunder_search/thunder_search.install b/modules/thunder_search/thunder_search.install deleted file mode 100644 index 30855a17c..000000000 --- a/modules/thunder_search/thunder_search.install +++ /dev/null @@ -1,20 +0,0 @@ -setStatus(FALSE)->save(); - } - if ($view = View::load('thunder_media')) { - $view->setStatus(FALSE)->save(); - } -} diff --git a/thunder.profile b/thunder.profile index 5a67b77a0..5a575f29e 100644 --- a/thunder.profile +++ b/thunder.profile @@ -140,6 +140,7 @@ function _thunder_install_module_batch($module, $module_name, $form_values, &$co $definition = $optionalModulesManager->getDefinition($module_name); if ($definition['type'] == 'module') { \Drupal::service('module_installer')->install($module, TRUE); + \Drupal::service('config.installer')->installOptionalConfig(); } elseif ($definition['type'] == 'theme') { \Drupal::service('theme_installer')->install($module, TRUE); From 603373544585e4ca751f18990ad2f5678831e99e Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 20 Feb 2018 15:55:10 +0100 Subject: [PATCH 025/134] Add local tasks to content view --- .../Plugin/Derivative/DynamicLocalTasks.php | 83 +++++++++++++++++++ .../thunder_article.links.task.yml | 4 + .../thunder_article/thunder_article.module | 9 ++ 3 files changed, 96 insertions(+) create mode 100644 modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php create mode 100644 modules/thunder_article/thunder_article.links.task.yml diff --git a/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php b/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php new file mode 100644 index 000000000..672fd43af --- /dev/null +++ b/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php @@ -0,0 +1,83 @@ +stringTranslation = $string_translation; + $this->moduleHandler = $module_handler; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, $base_plugin_id) { + return new static( + $container->get('string_translation'), + $container->get('module_handler') + ); + } + + /** + * {@inheritdoc} + */ + public function getDerivativeDefinitions($base_plugin_definition) { + $this->derivatives = []; + + $this->derivatives["thunder_article.overview"] = [ + 'route_name' => "system.admin_content", + 'title' => $this->t('Overview'), + 'parent_id' => "system.admin_content", + 'weight' => 1, + ] + $base_plugin_definition; + + if ($this->moduleHandler->moduleExists('content_lock')) { + $this->derivatives["thunder_article.content_lock"] = [ + 'route_name' => "view.locked_content.page_1", + 'title' => $this->t('Locked content'), + 'parent_id' => "system.admin_content", + 'weight' => 2, + ] + $base_plugin_definition; + } + + if ($this->moduleHandler->moduleExists('scheduler')) { + $this->derivatives["thunder_article.scheduler"] = [ + 'route_name' => "view.scheduler_scheduled_content.overview", + 'title' => $this->t('Scheduled content'), + 'parent_id' => "system.admin_content", + 'weight' => 3, + ] + $base_plugin_definition; + } + + return $this->derivatives; + } + +} diff --git a/modules/thunder_article/thunder_article.links.task.yml b/modules/thunder_article/thunder_article.links.task.yml new file mode 100644 index 000000000..230e61430 --- /dev/null +++ b/modules/thunder_article/thunder_article.links.task.yml @@ -0,0 +1,4 @@ +thunder_article.content_view: + deriver: 'Drupal\thunder_article\Plugin\Derivative\DynamicLocalTasks' + weight: 100 + diff --git a/modules/thunder_article/thunder_article.module b/modules/thunder_article/thunder_article.module index bfb0ee143..b0dd36976 100644 --- a/modules/thunder_article/thunder_article.module +++ b/modules/thunder_article/thunder_article.module @@ -35,3 +35,12 @@ function _thunder_article_form_alter_helper(array &$form, FormStateInterface $fo // theme and if there is still a need to attach a library from the module. $form['#attached']['library'][] = 'thunder_article/article_form_styling'; } + +/** + * Implements hook_menu_local_tasks_alter(). + */ +function thunder_article_menu_local_tasks_alter(&$data, $route_name) { + if ($route_name == 'system.admin_content' && !empty($data['tabs'][0]['views_view:view.scheduler_scheduled_content.overview'])) { + unset($data['tabs'][0]['views_view:view.scheduler_scheduled_content.overview']); + } +} From 9401202c6cc40ae402d7b835bc5e48abceaa5c48 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 21 Feb 2018 09:20:31 +0100 Subject: [PATCH 026/134] Remove on all paths --- modules/thunder_article/thunder_article.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/thunder_article/thunder_article.module b/modules/thunder_article/thunder_article.module index b0dd36976..ecefa4da5 100644 --- a/modules/thunder_article/thunder_article.module +++ b/modules/thunder_article/thunder_article.module @@ -40,7 +40,7 @@ function _thunder_article_form_alter_helper(array &$form, FormStateInterface $fo * Implements hook_menu_local_tasks_alter(). */ function thunder_article_menu_local_tasks_alter(&$data, $route_name) { - if ($route_name == 'system.admin_content' && !empty($data['tabs'][0]['views_view:view.scheduler_scheduled_content.overview'])) { + if (!empty($data['tabs'][0]['views_view:view.scheduler_scheduled_content.overview'])) { unset($data['tabs'][0]['views_view:view.scheduler_scheduled_content.overview']); } } From a8050174e8d37198d6fb02f47696daa7fe7efa56 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 21 Feb 2018 09:50:42 +0100 Subject: [PATCH 027/134] Fix CS --- modules/thunder_article/thunder_article.links.task.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/thunder_article/thunder_article.links.task.yml b/modules/thunder_article/thunder_article.links.task.yml index 230e61430..51574f9d1 100644 --- a/modules/thunder_article/thunder_article.links.task.yml +++ b/modules/thunder_article/thunder_article.links.task.yml @@ -1,4 +1,3 @@ thunder_article.content_view: deriver: 'Drupal\thunder_article\Plugin\Derivative\DynamicLocalTasks' weight: 100 - From e8b3e3bc63a6bb9b2e431ecd15ac344cd4470ae1 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 21 Feb 2018 10:19:17 +0100 Subject: [PATCH 028/134] Use config_selector for content view replacement --- composer.json | 2 +- config/optional/views.view.content.yml | 5 ++ .../config/optional/facets.facet.author.yml | 4 +- .../optional/facets.facet.media_status.yml | 1 - .../facets.facet.promoted_to_front_page.yml | 4 +- .../config/optional/facets.facet.status.yml | 4 +- .../facets.facet.sticky_at_top_of_lists.yml | 4 +- .../config/optional/facets.facet.type.yml | 5 +- ...pi__views_page__content_search__page_1.yml | 4 +- ....yml => views.view.content_search_api.yml} | 79 ++----------------- 10 files changed, 24 insertions(+), 88 deletions(-) rename modules/thunder_search/config/optional/{views.view.content_search.yml => views.view.content_search_api.yml} (92%) diff --git a/composer.json b/composer.json index 9010f964e..67734b5ff 100644 --- a/composer.json +++ b/composer.json @@ -148,7 +148,7 @@ "drupal/thunder_admin": ">=1", "drupal/token": "^1.0", "drupal/video_embed_field": "^1.0", - "drupal/views_bulk_operations": "^1.0", + "drupal/views_bulk_operations": "^2.0", "drupal/views_load_more": "dev-1.x", "valiton/harbourmaster": "~8.1", "bower-asset/dropzone": "^5.1", diff --git a/config/optional/views.view.content.yml b/config/optional/views.view.content.yml index 2e58d4572..f7bc2d972 100644 --- a/config/optional/views.view.content.yml +++ b/config/optional/views.view.content.yml @@ -10,6 +10,7 @@ dependencies: - media_entity - node - user + - config_selector id: content label: Content module: node @@ -18,6 +19,10 @@ tag: default base_table: node_field_data base_field: nid core: 8.x +third_party_settings: + config_selector: + feature: thunder_content_view + priority: 0 display: default: display_options: diff --git a/modules/thunder_search/config/optional/facets.facet.author.yml b/modules/thunder_search/config/optional/facets.facet.author.yml index 3b0eb1612..94754c573 100644 --- a/modules/thunder_search/config/optional/facets.facet.author.yml +++ b/modules/thunder_search/config/optional/facets.facet.author.yml @@ -3,7 +3,7 @@ status: true dependencies: config: - search_api.index.content - - views.view.content_search + - views.view.content_search_api module: - search_api id: author @@ -13,7 +13,7 @@ weight: 0 min_count: 1 show_only_one_result: true field_identifier: uid -facet_source_id: 'search_api:views_page__content_search__page_1' +facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: dropdown config: diff --git a/modules/thunder_search/config/optional/facets.facet.media_status.yml b/modules/thunder_search/config/optional/facets.facet.media_status.yml index 526ee08e8..4c5d817f8 100644 --- a/modules/thunder_search/config/optional/facets.facet.media_status.yml +++ b/modules/thunder_search/config/optional/facets.facet.media_status.yml @@ -1,4 +1,3 @@ -uuid: f574126d-d88b-4b49-9f64-9d50e5cf37c8 langcode: en status: true dependencies: diff --git a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml index aabe7abae..40023495f 100644 --- a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml +++ b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml @@ -3,7 +3,7 @@ status: true dependencies: config: - search_api.index.content - - views.view.content_search + - views.view.content_search_api module: - search_api id: promoted_to_front_page @@ -13,7 +13,7 @@ weight: 0 min_count: 1 show_only_one_result: true field_identifier: promote -facet_source_id: 'search_api:views_page__content_search__page_1' +facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: dropdown config: diff --git a/modules/thunder_search/config/optional/facets.facet.status.yml b/modules/thunder_search/config/optional/facets.facet.status.yml index 70774b19c..0857bd015 100644 --- a/modules/thunder_search/config/optional/facets.facet.status.yml +++ b/modules/thunder_search/config/optional/facets.facet.status.yml @@ -3,7 +3,7 @@ status: true dependencies: config: - search_api.index.content - - views.view.content_search + - views.view.content_search_api module: - search_api id: status @@ -13,7 +13,7 @@ weight: 0 min_count: 1 show_only_one_result: true field_identifier: status -facet_source_id: 'search_api:views_page__content_search__page_1' +facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: dropdown config: diff --git a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml index b866c7d24..080b3e13b 100644 --- a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml +++ b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml @@ -3,7 +3,7 @@ status: true dependencies: config: - search_api.index.content - - views.view.content_search + - views.view.content_search_api module: - search_api id: sticky_at_top_of_lists @@ -13,7 +13,7 @@ weight: 0 min_count: 1 show_only_one_result: true field_identifier: sticky -facet_source_id: 'search_api:views_page__content_search__page_1' +facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: dropdown config: diff --git a/modules/thunder_search/config/optional/facets.facet.type.yml b/modules/thunder_search/config/optional/facets.facet.type.yml index 432ea2302..d60056c13 100644 --- a/modules/thunder_search/config/optional/facets.facet.type.yml +++ b/modules/thunder_search/config/optional/facets.facet.type.yml @@ -1,10 +1,9 @@ -uuid: b7dd447a-f51c-4276-9037-b2bb391d7e52 langcode: en status: true dependencies: config: - search_api.index.content - - views.view.content_search + - views.view.content_search_api module: - search_api id: type @@ -14,7 +13,7 @@ weight: 0 min_count: 1 show_only_one_result: true field_identifier: type -facet_source_id: 'search_api:views_page__content_search__page_1' +facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: dropdown config: diff --git a/modules/thunder_search/config/optional/facets.facet_source.search_api__views_page__content_search__page_1.yml b/modules/thunder_search/config/optional/facets.facet_source.search_api__views_page__content_search__page_1.yml index 3836b8f1e..b6661548a 100644 --- a/modules/thunder_search/config/optional/facets.facet_source.search_api__views_page__content_search__page_1.yml +++ b/modules/thunder_search/config/optional/facets.facet_source.search_api__views_page__content_search__page_1.yml @@ -1,8 +1,8 @@ langcode: en status: true dependencies: { } -id: search_api__views_page__content_search__page_1 -name: 'search_api:views_page__content_search__page_1' +id: search_api__views_page__content_search_api__page_1 +name: 'search_api:views_page__content_search_api__page_1' filter_key: '' url_processor: query_string breadcrumb: diff --git a/modules/thunder_search/config/optional/views.view.content_search.yml b/modules/thunder_search/config/optional/views.view.content_search_api.yml similarity index 92% rename from modules/thunder_search/config/optional/views.view.content_search.yml rename to modules/thunder_search/config/optional/views.view.content_search_api.yml index 876151afa..0cd36c6e9 100644 --- a/modules/thunder_search/config/optional/views.view.content_search.yml +++ b/modules/thunder_search/config/optional/views.view.content_search_api.yml @@ -12,7 +12,8 @@ dependencies: - thunder_search - user - views_bulk_operations -id: content_search + - config_selector +id: content_search_api label: Content module: views description: '' @@ -20,6 +21,10 @@ tag: '' base_table: search_api_index_content base_field: search_api_id core: 8.x +third_party_settings: + config_selector: + feature: thunder_content_view + priority: 1 display: default: display_plugin: default @@ -587,78 +592,6 @@ display: multi_type: separator multi_separator: ', ' plugin_id: search_api_field - publish_on: - id: publish_on - table: search_api_datasource_content_entity_node - field: publish_on - relationship: none - group_type: group - admin_label: '' - label: 'Publish on' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: timestamp - settings: - date_format: short - custom_date_format: '' - timezone: '' - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - field_rendering: true - fallback_handler: search_api - fallback_options: - link_to_item: false - multi_type: separator - multi_separator: ', ' - entity_type: node - plugin_id: search_api_field node_changed: id: node_changed table: search_api_index_content From b4c1f1eb1d73fafe21573edf1c88fc63a4f50aca Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 21 Feb 2018 10:29:55 +0100 Subject: [PATCH 029/134] Use config_selector for media search --- .../config/optional/views.view.thunder_media.yml | 5 +++++ .../config/optional/facets.facet.media_status.yml | 4 ++-- .../config/optional/facets.facet.media_type.yml | 4 ++-- .../optional/facets.facet.publishing_status.yml | 4 ++-- ...arch_api__views_page__media_search_api__page_1.yml | 11 +++++++++++ ...dia_search.yml => views.view.media_search_api.yml} | 7 ++++++- modules/thunder_search/thunder_search.module | 8 ++++---- 7 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 modules/thunder_search/config/optional/facets.facet_source.search_api__views_page__media_search_api__page_1.yml rename modules/thunder_search/config/optional/{views.view.media_search.yml => views.view.media_search_api.yml} (99%) diff --git a/modules/thunder_media/config/optional/views.view.thunder_media.yml b/modules/thunder_media/config/optional/views.view.thunder_media.yml index 2dc2b22bc..8e7929f7d 100644 --- a/modules/thunder_media/config/optional/views.view.thunder_media.yml +++ b/modules/thunder_media/config/optional/views.view.thunder_media.yml @@ -9,6 +9,7 @@ dependencies: - image - media_entity - user + - config_selector id: thunder_media label: Media module: views @@ -17,6 +18,10 @@ tag: '' base_table: media_field_data base_field: mid core: 8.x +third_party_settings: + config_selector: + feature: thunder_media_view + priority: 0 display: default: display_plugin: default diff --git a/modules/thunder_search/config/optional/facets.facet.media_status.yml b/modules/thunder_search/config/optional/facets.facet.media_status.yml index 4c5d817f8..30e5b3423 100644 --- a/modules/thunder_search/config/optional/facets.facet.media_status.yml +++ b/modules/thunder_search/config/optional/facets.facet.media_status.yml @@ -3,7 +3,7 @@ status: true dependencies: config: - search_api.index.content - - views.view.media_search + - views.view.media_search_api module: - search_api id: media_status @@ -13,7 +13,7 @@ weight: 0 min_count: 1 show_only_one_result: true field_identifier: media_status -facet_source_id: 'search_api:views_page__media_search__page_1' +facet_source_id: 'search_api:views_page__media_search_api__page_1' widget: type: dropdown config: diff --git a/modules/thunder_search/config/optional/facets.facet.media_type.yml b/modules/thunder_search/config/optional/facets.facet.media_type.yml index 36a8fc9e1..1813ee9bd 100644 --- a/modules/thunder_search/config/optional/facets.facet.media_type.yml +++ b/modules/thunder_search/config/optional/facets.facet.media_type.yml @@ -3,7 +3,7 @@ status: true dependencies: config: - search_api.index.content - - views.view.media_search + - views.view.media_search_api module: - search_api id: media_type @@ -13,7 +13,7 @@ weight: 0 min_count: 1 show_only_one_result: true field_identifier: type -facet_source_id: 'search_api:views_page__media_search__page_1' +facet_source_id: 'search_api:views_page__media_search_api__page_1' widget: type: dropdown config: diff --git a/modules/thunder_search/config/optional/facets.facet.publishing_status.yml b/modules/thunder_search/config/optional/facets.facet.publishing_status.yml index 17dd8daab..83faa9817 100644 --- a/modules/thunder_search/config/optional/facets.facet.publishing_status.yml +++ b/modules/thunder_search/config/optional/facets.facet.publishing_status.yml @@ -3,7 +3,7 @@ status: true dependencies: config: - search_api.index.content - - views.view.media_search + - views.view.media_search_api module: - search_api id: publishing_status @@ -13,7 +13,7 @@ weight: 0 min_count: 1 show_only_one_result: true field_identifier: media_status -facet_source_id: 'search_api:views_page__media_search__page_1' +facet_source_id: 'search_api:views_page__media_search_api__page_1' widget: type: dropdown config: diff --git a/modules/thunder_search/config/optional/facets.facet_source.search_api__views_page__media_search_api__page_1.yml b/modules/thunder_search/config/optional/facets.facet_source.search_api__views_page__media_search_api__page_1.yml new file mode 100644 index 000000000..5198961ce --- /dev/null +++ b/modules/thunder_search/config/optional/facets.facet_source.search_api__views_page__media_search_api__page_1.yml @@ -0,0 +1,11 @@ +langcode: en +status: true +dependencies: { } +id: search_api__views_page__media_search_api__page_1 +name: 'search_api:views_page__media_search_api__page_1' +filter_key: '' +url_processor: query_string +breadcrumb: + active: false + before: true + group: false diff --git a/modules/thunder_search/config/optional/views.view.media_search.yml b/modules/thunder_search/config/optional/views.view.media_search_api.yml similarity index 99% rename from modules/thunder_search/config/optional/views.view.media_search.yml rename to modules/thunder_search/config/optional/views.view.media_search_api.yml index 66d1f4b8c..8051c1407 100644 --- a/modules/thunder_search/config/optional/views.view.media_search.yml +++ b/modules/thunder_search/config/optional/views.view.media_search_api.yml @@ -12,7 +12,8 @@ dependencies: - thunder_search - user - views_bulk_operations -id: media_search + - config_selector +id: media_search_api label: Media module: views description: '' @@ -20,6 +21,10 @@ tag: '' base_table: search_api_index_content base_field: search_api_id core: 8.x +third_party_settings: + config_selector: + feature: thunder_media_view + priority: 1 display: default: display_plugin: default diff --git a/modules/thunder_search/thunder_search.module b/modules/thunder_search/thunder_search.module index 88bf418f5..cf3f4a82a 100644 --- a/modules/thunder_search/thunder_search.module +++ b/modules/thunder_search/thunder_search.module @@ -24,9 +24,9 @@ function thunder_search_views_data() { */ function thunder_search_menu_local_actions_alter(&$local_actions) { /** @var \Drupal\views\ViewEntityInterface $view */ - $view = \Drupal::entityTypeManager()->getStorage('view')->load('media_search'); + $view = \Drupal::entityTypeManager()->getStorage('view')->load('media_search_api'); if ($view && $view->status()) { - $local_actions['media.add']['appears_on'][] = 'view.media_search.page_1'; + $local_actions['media.add']['appears_on'][] = 'view.media_search_api.page_1'; } } @@ -35,8 +35,8 @@ function thunder_search_menu_local_actions_alter(&$local_actions) { */ function thunder_search_menu_links_discovered_alter(&$links) { /** @var \Drupal\views\ViewEntityInterface $view */ - $view = \Drupal::entityTypeManager()->getStorage('view')->load('media_search'); + $view = \Drupal::entityTypeManager()->getStorage('view')->load('media_search_api'); if ($view && $view->status()) { - $links['entity.media.collection']['route_name'] = 'view.media_search.page_1'; + $links['entity.media.collection']['route_name'] = 'view.media_search_api.page_1'; } } From 187d11f3c074d60ed3fd39969087e170ec128415 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 21 Feb 2018 10:46:09 +0100 Subject: [PATCH 030/134] Remove not used file --- modules/thunder_search/thunder_search.libraries.yml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 modules/thunder_search/thunder_search.libraries.yml diff --git a/modules/thunder_search/thunder_search.libraries.yml b/modules/thunder_search/thunder_search.libraries.yml deleted file mode 100644 index 04795e7d9..000000000 --- a/modules/thunder_search/thunder_search.libraries.yml +++ /dev/null @@ -1,5 +0,0 @@ -search_box: - version: VERSION - css: - theme: - css/search_box.css: {} From 02123b6053f70aa7f2ee30a5bb370993a33d3167 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Fri, 23 Feb 2018 11:10:07 +0100 Subject: [PATCH 031/134] Use config_selector to get enabled media view --- .../thunder_riddle/thunder_riddle.module | 7 ++++-- modules/thunder_media/thunder_media.module | 14 ++++++++---- modules/thunder_search/thunder_search.module | 22 ------------------- 3 files changed, 15 insertions(+), 28 deletions(-) diff --git a/modules/thunder_article/modules/thunder_riddle/thunder_riddle.module b/modules/thunder_article/modules/thunder_riddle/thunder_riddle.module index 27f5b310d..4fb0328df 100644 --- a/modules/thunder_article/modules/thunder_riddle/thunder_riddle.module +++ b/modules/thunder_article/modules/thunder_riddle/thunder_riddle.module @@ -9,10 +9,13 @@ * Implements hook_menu_local_actions_alter(). */ function thunder_riddle_menu_local_actions_alter(&$local_actions) { + /** @var \Drupal\config_selector\ActiveEntity $config_selector */ + $config_selector = \Drupal::service('config_selector.active'); /** @var \Drupal\views\ViewEntityInterface $view */ - $view = \Drupal::entityTypeManager()->getStorage('view')->load('thunder_media'); + $view = $config_selector->get('view', 'thunder_media_view'); if ($view && $view->status()) { - $local_actions['riddle_marketplace.import']['appears_on'][] = 'view.thunder_media.media_page_list'; + $view->getExecutable()->initDisplay(); + $local_actions['riddle_marketplace.import']['appears_on'][] = $view->getExecutable()->getUrl()->getRouteName(); } } diff --git a/modules/thunder_media/thunder_media.module b/modules/thunder_media/thunder_media.module index a23131c49..82ccb7219 100644 --- a/modules/thunder_media/thunder_media.module +++ b/modules/thunder_media/thunder_media.module @@ -62,10 +62,13 @@ function thunder_media_page_attachments(array &$page) { * Implements hook_menu_local_actions_alter(). */ function thunder_media_menu_local_actions_alter(&$local_actions) { + /** @var \Drupal\config_selector\ActiveEntity $config_selector */ + $config_selector = \Drupal::service('config_selector.active'); /** @var \Drupal\views\ViewEntityInterface $view */ - $view = \Drupal::entityTypeManager()->getStorage('view')->load('thunder_media'); + $view = $config_selector->get('view', 'thunder_media_view'); if ($view && $view->status()) { - $local_actions['media.add']['appears_on'][] = 'view.thunder_media.media_page_list'; + $view->getExecutable()->initDisplay(); + $local_actions['media.add']['appears_on'][] = $view->getExecutable()->getUrl()->getRouteName(); } } @@ -73,10 +76,13 @@ function thunder_media_menu_local_actions_alter(&$local_actions) { * Implements hook_menu_links_discovered_alter(). */ function thunder_media_menu_links_discovered_alter(&$links) { + /** @var \Drupal\config_selector\ActiveEntity $config_selector */ + $config_selector = \Drupal::service('config_selector.active'); /** @var \Drupal\views\ViewEntityInterface $view */ - $view = \Drupal::entityTypeManager()->getStorage('view')->load('thunder_media'); + $view = $config_selector->get('view', 'thunder_media_view'); if ($view && $view->status()) { - $links['entity.media.collection']['route_name'] = 'view.thunder_media.media_page_list'; + $view->getExecutable()->initDisplay(); + $links['entity.media.collection']['route_name'] = $view->getExecutable()->getUrl()->getRouteName(); } } diff --git a/modules/thunder_search/thunder_search.module b/modules/thunder_search/thunder_search.module index cf3f4a82a..888d51f7f 100644 --- a/modules/thunder_search/thunder_search.module +++ b/modules/thunder_search/thunder_search.module @@ -18,25 +18,3 @@ function thunder_search_views_data() { ]; return $data; } - -/** - * Implements hook_menu_local_actions_alter(). - */ -function thunder_search_menu_local_actions_alter(&$local_actions) { - /** @var \Drupal\views\ViewEntityInterface $view */ - $view = \Drupal::entityTypeManager()->getStorage('view')->load('media_search_api'); - if ($view && $view->status()) { - $local_actions['media.add']['appears_on'][] = 'view.media_search_api.page_1'; - } -} - -/** - * Implements hook_menu_links_discovered_alter(). - */ -function thunder_search_menu_links_discovered_alter(&$links) { - /** @var \Drupal\views\ViewEntityInterface $view */ - $view = \Drupal::entityTypeManager()->getStorage('view')->load('media_search_api'); - if ($view && $view->status()) { - $links['entity.media.collection']['route_name'] = 'view.media_search_api.page_1'; - } -} From 5925e84ebb92ff1ed8a8258f4bf7439420097441 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Fri, 23 Feb 2018 11:30:51 +0100 Subject: [PATCH 032/134] Try to fix config --- config/optional/views.view.content.yml | 2 +- .../config/optional/views.view.thunder_media.yml | 2 +- ..._api__views_page__content_search_api__page_1.yml} | 0 tests/src/Functional/InstalledConfigurationTest.php | 12 ------------ 4 files changed, 2 insertions(+), 14 deletions(-) rename modules/thunder_search/config/optional/{facets.facet_source.search_api__views_page__content_search__page_1.yml => facets.facet_source.search_api__views_page__content_search_api__page_1.yml} (100%) diff --git a/config/optional/views.view.content.yml b/config/optional/views.view.content.yml index f7bc2d972..855918a19 100644 --- a/config/optional/views.view.content.yml +++ b/config/optional/views.view.content.yml @@ -1,5 +1,5 @@ langcode: en -status: true +status: false dependencies: config: - field.storage.node.field_channel diff --git a/modules/thunder_media/config/optional/views.view.thunder_media.yml b/modules/thunder_media/config/optional/views.view.thunder_media.yml index 8e7929f7d..145afebfd 100644 --- a/modules/thunder_media/config/optional/views.view.thunder_media.yml +++ b/modules/thunder_media/config/optional/views.view.thunder_media.yml @@ -1,5 +1,5 @@ langcode: en -status: true +status: false dependencies: config: - field.storage.media.field_expires diff --git a/modules/thunder_search/config/optional/facets.facet_source.search_api__views_page__content_search__page_1.yml b/modules/thunder_search/config/optional/facets.facet_source.search_api__views_page__content_search_api__page_1.yml similarity index 100% rename from modules/thunder_search/config/optional/facets.facet_source.search_api__views_page__content_search__page_1.yml rename to modules/thunder_search/config/optional/facets.facet_source.search_api__views_page__content_search_api__page_1.yml diff --git a/tests/src/Functional/InstalledConfigurationTest.php b/tests/src/Functional/InstalledConfigurationTest.php index 99aa55960..9ba1fd622 100644 --- a/tests/src/Functional/InstalledConfigurationTest.php +++ b/tests/src/Functional/InstalledConfigurationTest.php @@ -172,18 +172,6 @@ class InstalledConfigurationTest extends ThunderBaseTest { ], 'status' => TRUE, ], - 'views.view.thunder_media' => [ - 'dependencies' => [ - 'config' => TRUE, - ], - 'status' => TRUE, - ], - 'views.view.content' => [ - 'dependencies' => [ - 'config' => TRUE, - ], - 'status' => FALSE, - ], // Changed on installation. 'views.view.glossary' => [ From f8b630af9577aeb2b7e7997375e6b8420ad92bc3 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Mon, 26 Feb 2018 11:45:31 +0100 Subject: [PATCH 033/134] Update search_api --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5f9f0f5db..c9273e7bc 100644 --- a/composer.json +++ b/composer.json @@ -140,7 +140,7 @@ "drupal/redirect": "1.0", "drupal/riddle_marketplace": "^2.0", "drupal/scheduler": "^1.0", - "drupal/search_api": "1.6", + "drupal/search_api": "1.7", "drupal/simple_sitemap": "^2.0", "drupal/shariff": "^1.0", "drupal/slick": "^1.0", From ae5fa45c3c05ea65b3ee3557e5668d00f976b107 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 6 Mar 2018 12:42:57 +0100 Subject: [PATCH 034/134] Remove content_lock and scheduler fields --- config/optional/views.view.content.yml | 195 ------------------ .../Plugin/Derivative/DynamicLocalTasks.php | 9 - .../thunder_article.links.task.yml | 6 + 3 files changed, 6 insertions(+), 204 deletions(-) diff --git a/config/optional/views.view.content.yml b/config/optional/views.view.content.yml index 2e58d4572..a4c83b994 100644 --- a/config/optional/views.view.content.yml +++ b/config/optional/views.view.content.yml @@ -6,7 +6,6 @@ dependencies: - field.storage.node.field_teaser_media - image.style.thumbnail module: - - content_lock - media_entity - node - user @@ -400,191 +399,6 @@ display: plugin_id: field entity_type: node entity_field: status - publish_on: - id: publish_on - table: node_field_data - field: publish_on - relationship: none - group_type: group - admin_label: '' - label: 'Publish on' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: timestamp - settings: - date_format: short - custom_date_format: '' - timezone: '' - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: node - entity_field: publish_on - plugin_id: field - is_locked: - id: is_locked - table: content_lock - field: is_locked - relationship: none - group_type: group - admin_label: '' - label: 'Is Locked' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: yes-no - type_custom_true: '' - type_custom_false: '' - not: false - plugin_id: boolean - name: - id: name - table: users_field_data - field: name - relationship: uid_1 - group_type: group - admin_label: '' - label: 'Lock owner' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: user_name - settings: - link_to_entity: true - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: user - entity_field: name - plugin_id: field changed: id: changed table: node_field_data @@ -997,15 +811,6 @@ display: admin_label: author required: true plugin_id: standard - uid_1: - id: uid_1 - table: content_lock - field: uid - relationship: none - group_type: group - admin_label: 'Lock owner' - required: false - plugin_id: standard show_admin_links: false filter_groups: operator: AND diff --git a/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php b/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php index 672fd43af..b82edcd11 100644 --- a/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php +++ b/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php @@ -50,15 +50,6 @@ public static function create(ContainerInterface $container, $base_plugin_id) { * {@inheritdoc} */ public function getDerivativeDefinitions($base_plugin_definition) { - $this->derivatives = []; - - $this->derivatives["thunder_article.overview"] = [ - 'route_name' => "system.admin_content", - 'title' => $this->t('Overview'), - 'parent_id' => "system.admin_content", - 'weight' => 1, - ] + $base_plugin_definition; - if ($this->moduleHandler->moduleExists('content_lock')) { $this->derivatives["thunder_article.content_lock"] = [ 'route_name' => "view.locked_content.page_1", diff --git a/modules/thunder_article/thunder_article.links.task.yml b/modules/thunder_article/thunder_article.links.task.yml index 51574f9d1..276dba173 100644 --- a/modules/thunder_article/thunder_article.links.task.yml +++ b/modules/thunder_article/thunder_article.links.task.yml @@ -1,3 +1,9 @@ thunder_article.content_view: deriver: 'Drupal\thunder_article\Plugin\Derivative\DynamicLocalTasks' weight: 100 + +# We need an 'Overview' task also it content_moderation is not enabled +content_moderation.content: + title: 'Overview' + route_name: system.admin_content + parent_id: system.admin_content From a4d5f91138321d059fc62d8aff2d36a38d73b38e Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 6 Mar 2018 14:26:12 +0100 Subject: [PATCH 035/134] Rename filters --- config/optional/views.view.content.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/optional/views.view.content.yml b/config/optional/views.view.content.yml index a4c83b994..58c3c944c 100644 --- a/config/optional/views.view.content.yml +++ b/config/optional/views.view.content.yml @@ -721,7 +721,7 @@ display: administrator: '0' is_grouped: true group_info: - label: 'Promoted to front page' + label: Promoted description: '' identifier: promote optional: true @@ -771,7 +771,7 @@ display: administrator: '0' is_grouped: true group_info: - label: 'Sticky at top of lists' + label: Sticky description: '' identifier: sticky optional: true From 2316bc6932c3075c3b2c33b5e1c42dc551aed306 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 6 Mar 2018 15:18:21 +0100 Subject: [PATCH 036/134] Enhance check for scheduler menu item --- modules/thunder_article/thunder_article.module | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/thunder_article/thunder_article.module b/modules/thunder_article/thunder_article.module index ecefa4da5..62a2ef57c 100644 --- a/modules/thunder_article/thunder_article.module +++ b/modules/thunder_article/thunder_article.module @@ -40,7 +40,9 @@ function _thunder_article_form_alter_helper(array &$form, FormStateInterface $fo * Implements hook_menu_local_tasks_alter(). */ function thunder_article_menu_local_tasks_alter(&$data, $route_name) { - if (!empty($data['tabs'][0]['views_view:view.scheduler_scheduled_content.overview'])) { - unset($data['tabs'][0]['views_view:view.scheduler_scheduled_content.overview']); + foreach ($data['tabs'] as $key => $tab) { + if (!empty($tab['views_view:view.scheduler_scheduled_content.overview'])) { + unset($data['tabs'][$key]['views_view:view.scheduler_scheduled_content.overview']); + } } } From f0295b1fe933c97499cbe483b15c81a18fe3d1f4 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 6 Mar 2018 15:33:01 +0100 Subject: [PATCH 037/134] Add required modules and reimport content view --- thunder.profile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/thunder.profile b/thunder.profile index 3c8dc641d..441dd00e8 100644 --- a/thunder.profile +++ b/thunder.profile @@ -15,7 +15,7 @@ use Drupal\block\Entity\Block; function thunder_system_info_alter(array &$info, Extension $file, $type) { // Thunder can not work properly without these modules. So they are enforced // to be enabled. - $required_modules = ['config_selector']; + $required_modules = ['config_selector', 'views', 'media_entity', 'node']; if ($type == 'module' && in_array($file->getName(), $required_modules)) { $info['required'] = TRUE; } @@ -334,6 +334,22 @@ function thunder_modules_installed($modules) { } } +/** + * Implements hook_modules_uninstalled(). + */ +function thunder_modules_uninstall($modules) { + // Import the content view if it was deleted during module uninstalling. + // This could happen if content_lock was uninstalled and the content view + // contained content_lock fields at that time. + /** @var \Drupal\Core\Routing\RouteProviderInterface $route_provider */ + $route_provider = \Drupal::service('router.route_provider'); + $found_routes = $route_provider->getRoutesByPattern('admin/content'); + if (!$found_routes->count()) { + $config_service = \Drupal::service('config_update.config_update'); + $config_service->import('view', 'content'); + } +} + /** * Implements hook_page_attachments(). */ From d9dac01c1790d1fb5127ff511eec33a7406e99f3 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 6 Mar 2018 16:27:35 +0100 Subject: [PATCH 038/134] Check if route exists --- .../Plugin/Derivative/DynamicLocalTasks.php | 21 +++++++++++++++---- thunder.profile | 8 ++++++- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php b/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php index b82edcd11..185c23fe9 100644 --- a/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php +++ b/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php @@ -5,8 +5,10 @@ use Drupal\Component\Plugin\Derivative\DeriverBase; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; +use Drupal\Core\Routing\RouteProviderInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; +use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -23,6 +25,13 @@ class DynamicLocalTasks extends DeriverBase implements ContainerDeriverInterface */ protected $moduleHandler; + /** + * The route provider service. + * + * @var \Drupal\Core\Routing\RouteProviderInterface + */ + protected $routeProvider; + /** * Creates an DynamicLocalTasks object. * @@ -30,10 +39,13 @@ class DynamicLocalTasks extends DeriverBase implements ContainerDeriverInterface * The translation manager. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler service. + * @param \Drupal\Core\Routing\RouteProviderInterface $route_provider + * The route provider service.. */ - public function __construct(TranslationInterface $string_translation, ModuleHandlerInterface $module_handler) { + public function __construct(TranslationInterface $string_translation, ModuleHandlerInterface $module_handler, RouteProviderInterface $route_provider) { $this->stringTranslation = $string_translation; $this->moduleHandler = $module_handler; + $this->routeProvider = $route_provider; } /** @@ -42,7 +54,8 @@ public function __construct(TranslationInterface $string_translation, ModuleHand public static function create(ContainerInterface $container, $base_plugin_id) { return new static( $container->get('string_translation'), - $container->get('module_handler') + $container->get('module_handler'), + $container->get('router.route_provider') ); } @@ -50,7 +63,7 @@ public static function create(ContainerInterface $container, $base_plugin_id) { * {@inheritdoc} */ public function getDerivativeDefinitions($base_plugin_definition) { - if ($this->moduleHandler->moduleExists('content_lock')) { + if ($this->moduleHandler->moduleExists('content_lock') && $this->routeProvider->getRoutesByNames(['view.locked_content.page_1'])) { $this->derivatives["thunder_article.content_lock"] = [ 'route_name' => "view.locked_content.page_1", 'title' => $this->t('Locked content'), @@ -59,7 +72,7 @@ public function getDerivativeDefinitions($base_plugin_definition) { ] + $base_plugin_definition; } - if ($this->moduleHandler->moduleExists('scheduler')) { + if ($this->moduleHandler->moduleExists('scheduler') && $this->routeProvider->getRoutesByNames(['view.scheduler_scheduled_content.overview'])) { $this->derivatives["thunder_article.scheduler"] = [ 'route_name' => "view.scheduler_scheduled_content.overview", 'title' => $this->t('Scheduled content'), diff --git a/thunder.profile b/thunder.profile index 441dd00e8..798cb30d7 100644 --- a/thunder.profile +++ b/thunder.profile @@ -344,7 +344,13 @@ function thunder_modules_uninstall($modules) { /** @var \Drupal\Core\Routing\RouteProviderInterface $route_provider */ $route_provider = \Drupal::service('router.route_provider'); $found_routes = $route_provider->getRoutesByPattern('admin/content'); - if (!$found_routes->count()) { + $view_found = FALSE; + foreach ($found_routes->getIterator() as $route) { + if (!empty($route->getDefault('view_id'))) { + $view_found = TRUE; + } + } + if (!$view_found) { $config_service = \Drupal::service('config_update.config_update'); $config_service->import('view', 'content'); } From a719ca079ae4ec17f68d4907a32484c91887bc18 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 6 Mar 2018 16:43:30 +0100 Subject: [PATCH 039/134] Recover view only when content_lock was removed --- .../thunder_article.links.task.yml | 2 +- thunder.profile | 24 ++++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/modules/thunder_article/thunder_article.links.task.yml b/modules/thunder_article/thunder_article.links.task.yml index 276dba173..57fab5159 100644 --- a/modules/thunder_article/thunder_article.links.task.yml +++ b/modules/thunder_article/thunder_article.links.task.yml @@ -2,7 +2,7 @@ thunder_article.content_view: deriver: 'Drupal\thunder_article\Plugin\Derivative\DynamicLocalTasks' weight: 100 -# We need an 'Overview' task also it content_moderation is not enabled +# We need an 'Overview' task also when content_moderation is not enabled content_moderation.content: title: 'Overview' route_name: system.admin_content diff --git a/thunder.profile b/thunder.profile index 798cb30d7..a8a3e8f5f 100644 --- a/thunder.profile +++ b/thunder.profile @@ -341,18 +341,20 @@ function thunder_modules_uninstall($modules) { // Import the content view if it was deleted during module uninstalling. // This could happen if content_lock was uninstalled and the content view // contained content_lock fields at that time. - /** @var \Drupal\Core\Routing\RouteProviderInterface $route_provider */ - $route_provider = \Drupal::service('router.route_provider'); - $found_routes = $route_provider->getRoutesByPattern('admin/content'); - $view_found = FALSE; - foreach ($found_routes->getIterator() as $route) { - if (!empty($route->getDefault('view_id'))) { - $view_found = TRUE; + if (in_array('content_lock', $modules)) { + /** @var \Drupal\Core\Routing\RouteProviderInterface $route_provider */ + $route_provider = \Drupal::service('router.route_provider'); + $found_routes = $route_provider->getRoutesByPattern('admin/content'); + $view_found = FALSE; + foreach ($found_routes->getIterator() as $route) { + if (!empty($route->getDefault('view_id'))) { + $view_found = TRUE; + } + } + if (!$view_found) { + $config_service = \Drupal::service('config_update.config_update'); + $config_service->import('view', 'content'); } - } - if (!$view_found) { - $config_service = \Drupal::service('config_update.config_update'); - $config_service->import('view', 'content'); } } From 8b8f6967a21d719870a48e6bea4298685a0df776 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 6 Mar 2018 16:50:47 +0100 Subject: [PATCH 040/134] Wrong hook name --- thunder.profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thunder.profile b/thunder.profile index a8a3e8f5f..8bf9356a6 100644 --- a/thunder.profile +++ b/thunder.profile @@ -337,7 +337,7 @@ function thunder_modules_installed($modules) { /** * Implements hook_modules_uninstalled(). */ -function thunder_modules_uninstall($modules) { +function thunder_modules_uninstalled($modules) { // Import the content view if it was deleted during module uninstalling. // This could happen if content_lock was uninstalled and the content view // contained content_lock fields at that time. From 815fdb5854f1f2992de9ee795c7367369df03a20 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 6 Mar 2018 16:51:39 +0100 Subject: [PATCH 041/134] CS fixes --- .../thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php b/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php index 185c23fe9..53f5d3348 100644 --- a/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php +++ b/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php @@ -8,7 +8,6 @@ use Drupal\Core\Routing\RouteProviderInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; -use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; /** From 8ea621568f9cb6aa1b7d21176ee83ae218e969ee Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 6 Mar 2018 18:12:05 +0100 Subject: [PATCH 042/134] Add break --- thunder.profile | 1 + 1 file changed, 1 insertion(+) diff --git a/thunder.profile b/thunder.profile index 8bf9356a6..3c095f1c6 100644 --- a/thunder.profile +++ b/thunder.profile @@ -349,6 +349,7 @@ function thunder_modules_uninstalled($modules) { foreach ($found_routes->getIterator() as $route) { if (!empty($route->getDefault('view_id'))) { $view_found = TRUE; + break; } } if (!$view_found) { From 23adcae55c22bfd7b0e86cf854954a58f6411d45 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 7 Mar 2018 09:27:56 +0100 Subject: [PATCH 043/134] Add config form --- .../install/thunder_article.settings.yml | 1 + .../config/schema/thunder_article.schema.yml | 7 ++ .../src/Form/ConfigurationForm.php | 99 +++++++++++++++++++ .../Plugin/Derivative/DynamicLocalTasks.php | 20 +++- .../thunder_article.links.menu.yml | 6 ++ .../thunder_article/thunder_article.module | 10 +- .../thunder_article.post_update.php | 15 +++ .../thunder_article.routing.yml | 9 ++ 8 files changed, 160 insertions(+), 7 deletions(-) create mode 100644 modules/thunder_article/config/install/thunder_article.settings.yml create mode 100644 modules/thunder_article/config/schema/thunder_article.schema.yml create mode 100644 modules/thunder_article/src/Form/ConfigurationForm.php create mode 100644 modules/thunder_article/thunder_article.links.menu.yml create mode 100644 modules/thunder_article/thunder_article.post_update.php create mode 100644 modules/thunder_article/thunder_article.routing.yml diff --git a/modules/thunder_article/config/install/thunder_article.settings.yml b/modules/thunder_article/config/install/thunder_article.settings.yml new file mode 100644 index 000000000..ca863aa42 --- /dev/null +++ b/modules/thunder_article/config/install/thunder_article.settings.yml @@ -0,0 +1 @@ +move_scheduler_local_task: true diff --git a/modules/thunder_article/config/schema/thunder_article.schema.yml b/modules/thunder_article/config/schema/thunder_article.schema.yml new file mode 100644 index 000000000..cafd52af5 --- /dev/null +++ b/modules/thunder_article/config/schema/thunder_article.schema.yml @@ -0,0 +1,7 @@ +thunder_article.settings: + type: config_object + mapping: + move_scheduler_local_task: + type: boolean + label: 'Move scheduler to local task of content list' + diff --git a/modules/thunder_article/src/Form/ConfigurationForm.php b/modules/thunder_article/src/Form/ConfigurationForm.php new file mode 100644 index 000000000..d92d4ed05 --- /dev/null +++ b/modules/thunder_article/src/Form/ConfigurationForm.php @@ -0,0 +1,99 @@ +localTaskLinkManager = $localTaskLinkManager; + $this->cacheRender = $cacheRender; + + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('config.factory'), + $container->get('plugin.manager.menu.local_task'), + $container->get('cache.render') + + ); + } + + /** + * {@inheritdoc} + */ + protected function getEditableConfigNames() { + return [ + 'thunder_article.settings', + ]; + } + + /** + * {@inheritdoc} + */ + public function getFormId() { + return 'configuration_form'; + } + + /** + * {@inheritdoc} + */ + public function buildForm(array $form, FormStateInterface $form_state) { + $config = $this->config('thunder_article.settings'); + + $form['move_scheduler_local_task'] = [ + '#type' => 'checkbox', + '#title' => $this->t('Move scheduler to local task of content list'), + '#description' => $this->t('Disable this checkbox to get the scheduler default behavior.'), + '#default_value' => $config->get('move_scheduler_local_task'), + ]; + + return parent::buildForm($form, $form_state); + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + parent::submitForm($form, $form_state); + + $this->config('thunder_article.settings') + ->set('move_scheduler_local_task', $form_state->getValue('move_scheduler_local_task')) + ->save(); + + $this->localTaskLinkManager->clearCachedDefinitions(); + $this->cacheRender->invalidateAll(); + } + +} diff --git a/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php b/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php index 53f5d3348..858089e75 100644 --- a/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php +++ b/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php @@ -3,6 +3,7 @@ namespace Drupal\thunder_article\Plugin\Derivative; use Drupal\Component\Plugin\Derivative\DeriverBase; +use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Drupal\Core\Routing\RouteProviderInterface; @@ -31,6 +32,13 @@ class DynamicLocalTasks extends DeriverBase implements ContainerDeriverInterface */ protected $routeProvider; + /** + * The config factory service. + * + * @var \Drupal\Core\Config\ConfigFactoryInterface + */ + protected $configFactory; + /** * Creates an DynamicLocalTasks object. * @@ -39,12 +47,15 @@ class DynamicLocalTasks extends DeriverBase implements ContainerDeriverInterface * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler service. * @param \Drupal\Core\Routing\RouteProviderInterface $route_provider - * The route provider service.. + * The route provider service. + * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory + * The config factory service. */ - public function __construct(TranslationInterface $string_translation, ModuleHandlerInterface $module_handler, RouteProviderInterface $route_provider) { + public function __construct(TranslationInterface $string_translation, ModuleHandlerInterface $module_handler, RouteProviderInterface $route_provider, ConfigFactoryInterface $config_factory) { $this->stringTranslation = $string_translation; $this->moduleHandler = $module_handler; $this->routeProvider = $route_provider; + $this->configFactory = $config_factory; } /** @@ -54,7 +65,8 @@ public static function create(ContainerInterface $container, $base_plugin_id) { return new static( $container->get('string_translation'), $container->get('module_handler'), - $container->get('router.route_provider') + $container->get('router.route_provider'), + $container->get('config.factory') ); } @@ -71,7 +83,7 @@ public function getDerivativeDefinitions($base_plugin_definition) { ] + $base_plugin_definition; } - if ($this->moduleHandler->moduleExists('scheduler') && $this->routeProvider->getRoutesByNames(['view.scheduler_scheduled_content.overview'])) { + if ($this->configFactory->get('thunder_article.settings')->get('move_scheduler_local_task') && $this->moduleHandler->moduleExists('scheduler') && $this->routeProvider->getRoutesByNames(['view.scheduler_scheduled_content.overview'])) { $this->derivatives["thunder_article.scheduler"] = [ 'route_name' => "view.scheduler_scheduled_content.overview", 'title' => $this->t('Scheduled content'), diff --git a/modules/thunder_article/thunder_article.links.menu.yml b/modules/thunder_article/thunder_article.links.menu.yml new file mode 100644 index 000000000..9271ecc4f --- /dev/null +++ b/modules/thunder_article/thunder_article.links.menu.yml @@ -0,0 +1,6 @@ +thunder_article.configuration_form: + title: 'Thunder Article Configuration' + route_name: thunder_article.configuration_form + description: 'Thunder Article configuration' + parent: system.admin_config_content + weight: 99 diff --git a/modules/thunder_article/thunder_article.module b/modules/thunder_article/thunder_article.module index 62a2ef57c..f7e4d1a8e 100644 --- a/modules/thunder_article/thunder_article.module +++ b/modules/thunder_article/thunder_article.module @@ -40,9 +40,13 @@ function _thunder_article_form_alter_helper(array &$form, FormStateInterface $fo * Implements hook_menu_local_tasks_alter(). */ function thunder_article_menu_local_tasks_alter(&$data, $route_name) { - foreach ($data['tabs'] as $key => $tab) { - if (!empty($tab['views_view:view.scheduler_scheduled_content.overview'])) { - unset($data['tabs'][$key]['views_view:view.scheduler_scheduled_content.overview']); + /** @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory */ + $config_factory = \Drupal::service('config.factory'); + if ($config_factory->get('thunder_article.settings')->get('move_scheduler_local_task')) { + foreach ($data['tabs'] as $key => $tab) { + if (!empty($tab['views_view:view.scheduler_scheduled_content.overview'])) { + unset($data['tabs'][$key]['views_view:view.scheduler_scheduled_content.overview']); + } } } } diff --git a/modules/thunder_article/thunder_article.post_update.php b/modules/thunder_article/thunder_article.post_update.php new file mode 100644 index 000000000..35d76cbe8 --- /dev/null +++ b/modules/thunder_article/thunder_article.post_update.php @@ -0,0 +1,15 @@ +import('system.simple', 'thunder_article.settings'); +} diff --git a/modules/thunder_article/thunder_article.routing.yml b/modules/thunder_article/thunder_article.routing.yml new file mode 100644 index 000000000..920166a25 --- /dev/null +++ b/modules/thunder_article/thunder_article.routing.yml @@ -0,0 +1,9 @@ +thunder_article.configuration_form: + path: '/admin/config/thunder_article/configuration' + defaults: + _form: '\Drupal\thunder_article\Form\ConfigurationForm' + _title: 'Thunder Article Configuration' + requirements: + _permission: 'administer site configuration' + options: + _admin_route: TRUE From 2c701c4a6a6e5a5a3c08b0bbcb7d9338f8e0ce3b Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 7 Mar 2018 10:24:38 +0100 Subject: [PATCH 044/134] Add tests --- .../config/schema/thunder_article.schema.yml | 1 - tests/src/Functional/ContentListTest.php | 45 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 tests/src/Functional/ContentListTest.php diff --git a/modules/thunder_article/config/schema/thunder_article.schema.yml b/modules/thunder_article/config/schema/thunder_article.schema.yml index cafd52af5..38f383720 100644 --- a/modules/thunder_article/config/schema/thunder_article.schema.yml +++ b/modules/thunder_article/config/schema/thunder_article.schema.yml @@ -4,4 +4,3 @@ thunder_article.settings: move_scheduler_local_task: type: boolean label: 'Move scheduler to local task of content list' - diff --git a/tests/src/Functional/ContentListTest.php b/tests/src/Functional/ContentListTest.php new file mode 100644 index 000000000..56b58686d --- /dev/null +++ b/tests/src/Functional/ContentListTest.php @@ -0,0 +1,45 @@ +logWithRole('administrator'); + $this->drupalGet('admin/content'); + + $assert_session = $this->assertSession(); + $assert_session->elementTextContains('css', '#block-thunder-admin-secondary-local-tasks > nav > nav > ul', 'Overview'); + $assert_session->elementTextContains('css', '#block-thunder-admin-secondary-local-tasks > nav > nav > ul', 'Scheduled content'); + + $this->drupalPostForm('admin/config/thunder_article/configuration', ['move_scheduler_local_task' => 0], 'Save configuration'); + + $this->drupalGet('admin/content'); + + try { + $assert_session->elementTextNotContains('css', '#block-thunder-admin-secondary-local-tasks > nav > nav > ul', 'Scheduled content'); + } + catch (ElementNotFoundException $exception) { + } + + $assert_session->elementTextContains('css', '#block-thunder-admin-primary-local-tasks > nav > nav > ul', 'Scheduled'); + } + +} From d18e6b5eea7dbd3b5732ce5e8b63ad98dfe348c3 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 7 Mar 2018 10:32:33 +0100 Subject: [PATCH 045/134] Cleanup --- tests/src/Functional/ContentListTest.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/src/Functional/ContentListTest.php b/tests/src/Functional/ContentListTest.php index 56b58686d..d5619aa8e 100644 --- a/tests/src/Functional/ContentListTest.php +++ b/tests/src/Functional/ContentListTest.php @@ -25,21 +25,24 @@ public function testSchedulerLocalTask() { $this->logWithRole('administrator'); $this->drupalGet('admin/content'); + $primaryMenuBlockSelector = '#block-thunder-admin-primary-local-tasks > nav > nav > ul'; + $secondaryMenuBlockSelector = '#block-thunder-admin-secondary-local-tasks > nav > nav > ul'; + $assert_session = $this->assertSession(); - $assert_session->elementTextContains('css', '#block-thunder-admin-secondary-local-tasks > nav > nav > ul', 'Overview'); - $assert_session->elementTextContains('css', '#block-thunder-admin-secondary-local-tasks > nav > nav > ul', 'Scheduled content'); + $assert_session->elementTextContains('css', $secondaryMenuBlockSelector, 'Overview'); + $assert_session->elementTextContains('css', $secondaryMenuBlockSelector, 'Scheduled content'); $this->drupalPostForm('admin/config/thunder_article/configuration', ['move_scheduler_local_task' => 0], 'Save configuration'); $this->drupalGet('admin/content'); try { - $assert_session->elementTextNotContains('css', '#block-thunder-admin-secondary-local-tasks > nav > nav > ul', 'Scheduled content'); + $assert_session->elementTextNotContains('css', $secondaryMenuBlockSelector, 'Scheduled content'); } catch (ElementNotFoundException $exception) { } - $assert_session->elementTextContains('css', '#block-thunder-admin-primary-local-tasks > nav > nav > ul', 'Scheduled'); + $assert_session->elementTextContains('css', $primaryMenuBlockSelector, 'Scheduled'); } } From a3f70ef314ac48b3b82d0153fe0c37c64cc794ac Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 7 Mar 2018 10:33:41 +0100 Subject: [PATCH 046/134] Add group annotation --- tests/src/Functional/ContentListTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/src/Functional/ContentListTest.php b/tests/src/Functional/ContentListTest.php index d5619aa8e..7ab33b399 100644 --- a/tests/src/Functional/ContentListTest.php +++ b/tests/src/Functional/ContentListTest.php @@ -7,6 +7,8 @@ /** * Test the Thunder content list view. + * + * @group Thunder */ class ContentListTest extends ThunderBaseTest { From 96a1d6d0ff41adfa022b48ace690180f7a5f08b9 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 7 Mar 2018 12:05:37 +0100 Subject: [PATCH 047/134] Import new content lock view --- .../thunder_article.post_update.php | 18 ++++++++++++++++++ tests/src/Functional/ContentListTest.php | 10 +++------- thunder.profile | 2 +- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/modules/thunder_article/thunder_article.post_update.php b/modules/thunder_article/thunder_article.post_update.php index 35d76cbe8..551cc877c 100644 --- a/modules/thunder_article/thunder_article.post_update.php +++ b/modules/thunder_article/thunder_article.post_update.php @@ -5,11 +5,29 @@ * Post update functions for Thunder. */ +use Drupal\views\Entity\View; + /** * Move scheduler view tab to local task on content list. */ function thunder_article_post_update_move_scheduler_to_content_list() { + + /** @var \Drupal\thunder_updater\Updater $thunderUpdater */ + $thunderUpdater = \Drupal::service('thunder_updater'); + /** @var \Drupal\config_update\ConfigReverter $config_update */ $config_update = \Drupal::service('config_update.config_update'); $config_update->import('system.simple', 'thunder_article.settings'); + + $view = View::load('locked_content'); + if ($view) { + $view->set('id', 'locked_content_old'); + $view->save(); + $thunderUpdater->logger()->alert('The locked content view was renamed to views.view.locked_content_old.'); + } + $config_update->import('view', 'locked_content'); + $thunderUpdater->logger()->info('The new locked content view was imported as views.view.locked_content.'); + + // Output logged messages to related channel of update execution. + return $thunderUpdater->logger()->output(); } diff --git a/tests/src/Functional/ContentListTest.php b/tests/src/Functional/ContentListTest.php index 7ab33b399..56a8f47ba 100644 --- a/tests/src/Functional/ContentListTest.php +++ b/tests/src/Functional/ContentListTest.php @@ -2,7 +2,6 @@ namespace Drupal\Tests\thunder\Functional; -use Behat\Mink\Exception\ElementNotFoundException; use Drupal\thunder\ThunderBaseTest; /** @@ -33,18 +32,15 @@ public function testSchedulerLocalTask() { $assert_session = $this->assertSession(); $assert_session->elementTextContains('css', $secondaryMenuBlockSelector, 'Overview'); $assert_session->elementTextContains('css', $secondaryMenuBlockSelector, 'Scheduled content'); + $assert_session->elementTextContains('css', $secondaryMenuBlockSelector, 'Locked content'); $this->drupalPostForm('admin/config/thunder_article/configuration', ['move_scheduler_local_task' => 0], 'Save configuration'); $this->drupalGet('admin/content'); - try { - $assert_session->elementTextNotContains('css', $secondaryMenuBlockSelector, 'Scheduled content'); - } - catch (ElementNotFoundException $exception) { - } - + $assert_session->elementTextNotContains('css', $secondaryMenuBlockSelector, 'Scheduled content'); $assert_session->elementTextContains('css', $primaryMenuBlockSelector, 'Scheduled'); + $assert_session->elementTextContains('css', $secondaryMenuBlockSelector, 'Locked content'); } } diff --git a/thunder.profile b/thunder.profile index 3c095f1c6..e2e12c13d 100644 --- a/thunder.profile +++ b/thunder.profile @@ -341,7 +341,7 @@ function thunder_modules_uninstalled($modules) { // Import the content view if it was deleted during module uninstalling. // This could happen if content_lock was uninstalled and the content view // contained content_lock fields at that time. - if (in_array('content_lock', $modules)) { + if (in_array('content_lock', $modules, TRUE)) { /** @var \Drupal\Core\Routing\RouteProviderInterface $route_provider */ $route_provider = \Drupal::service('router.route_provider'); $found_routes = $route_provider->getRoutesByPattern('admin/content'); From 3c75d72448fa83a9fae819622d5c51292071e105 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 8 Mar 2018 10:50:04 +0100 Subject: [PATCH 048/134] Add update checklist point --- .../thunder_article.post_update.php | 22 +++++++++++-------- modules/thunder_updater/updates.yml | 9 ++++++++ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/modules/thunder_article/thunder_article.post_update.php b/modules/thunder_article/thunder_article.post_update.php index 551cc877c..ab4e80872 100644 --- a/modules/thunder_article/thunder_article.post_update.php +++ b/modules/thunder_article/thunder_article.post_update.php @@ -17,16 +17,20 @@ function thunder_article_post_update_move_scheduler_to_content_list() { /** @var \Drupal\config_update\ConfigReverter $config_update */ $config_update = \Drupal::service('config_update.config_update'); - $config_update->import('system.simple', 'thunder_article.settings'); - - $view = View::load('locked_content'); - if ($view) { - $view->set('id', 'locked_content_old'); - $view->save(); - $thunderUpdater->logger()->alert('The locked content view was renamed to views.view.locked_content_old.'); + if ($config_update->import('system.simple', 'thunder_article.settings')) { + $view = View::load('locked_content'); + if ($view) { + $view->set('id', 'locked_content_old'); + $view->save(); + $thunderUpdater->logger()->alert('The locked content view was renamed to views.view.locked_content_old.'); + } + if ($config_update->import('view', 'locked_content')) { + $thunderUpdater->logger()->info('The new locked content view was imported as views.view.locked_content.'); + $thunderUpdater->checklist()->markUpdatesSuccessful(['thunder_article_move_scheduler_to_content_list']); + } } - $config_update->import('view', 'locked_content'); - $thunderUpdater->logger()->info('The new locked content view was imported as views.view.locked_content.'); + + // Output logged messages to related channel of update execution. return $thunderUpdater->logger()->output(); diff --git a/modules/thunder_updater/updates.yml b/modules/thunder_updater/updates.yml index ff7c27732..d3a2e1722 100644 --- a/modules/thunder_updater/updates.yml +++ b/modules/thunder_updater/updates.yml @@ -200,3 +200,12 @@ v2.14: '#description_successful': '

The installation was successful.

' '#description_failed': '

Installation failed, visit the extension page and try to enable the module manually.

' extension_page: { '#text': 'Enable the Configuration Selector module', '#url': 'internal:/admin/modules' } +v2.16: + '#title': 'Update to Thunder 2.16' + '#description': '

These are the new features for this release:

' + thunder_article_move_scheduler_to_content_list: + '#title': 'Update locked content view and move scheduler tab to local tasks' + '#description': '

From now on we will not add functionality for content lists to the existing content list but will create a separate content list for each use-case.

We have replaced the current locked content view with a new one. The old one can still be reached under views.view.locked_content_old.

The scheduler tab has also been moved to the local tasks of the content list. This change can be undone under the menu item "Thunder article configuration".

' + '#description_successful': '

The installation was successful.

' + '#description_failed': '

Installation failed

' + thunder_article_config: { '#text': 'Revert scheduler into local tasks', '#url': 'internal:/admin/config/thunder_article/configuration' } From 80f355e4085c97e1aedca0212a895cd5535158d7 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 8 Mar 2018 13:27:30 +0100 Subject: [PATCH 049/134] Change wording --- modules/thunder_updater/updates.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/thunder_updater/updates.yml b/modules/thunder_updater/updates.yml index d3a2e1722..737447caa 100644 --- a/modules/thunder_updater/updates.yml +++ b/modules/thunder_updater/updates.yml @@ -208,4 +208,4 @@ v2.16: '#description': '

From now on we will not add functionality for content lists to the existing content list but will create a separate content list for each use-case.

We have replaced the current locked content view with a new one. The old one can still be reached under views.view.locked_content_old.

The scheduler tab has also been moved to the local tasks of the content list. This change can be undone under the menu item "Thunder article configuration".

' '#description_successful': '

The installation was successful.

' '#description_failed': '

Installation failed

' - thunder_article_config: { '#text': 'Revert scheduler into local tasks', '#url': 'internal:/admin/config/thunder_article/configuration' } + thunder_article_config: { '#text': 'Move scheduler link back from local tasks to menu tab', '#url': 'internal:/admin/config/thunder_article/configuration' } From 84d52eb52b2eed1e10d39205030ea98739c860cc Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 8 Mar 2018 13:41:34 +0100 Subject: [PATCH 050/134] Fix CS issue --- modules/thunder_article/thunder_article.post_update.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/thunder_article/thunder_article.post_update.php b/modules/thunder_article/thunder_article.post_update.php index ab4e80872..dc6b32e62 100644 --- a/modules/thunder_article/thunder_article.post_update.php +++ b/modules/thunder_article/thunder_article.post_update.php @@ -30,8 +30,6 @@ function thunder_article_post_update_move_scheduler_to_content_list() { } } - - // Output logged messages to related channel of update execution. return $thunderUpdater->logger()->output(); } From 02a2ae8747c0992eb3c6844fc68b03d8269e40af Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Thu, 8 Mar 2018 16:04:43 +0000 Subject: [PATCH 051/134] Remove cache clears from Configuration form --- .../src/Form/ConfigurationForm.php | 43 ------------------- .../Plugin/Derivative/DynamicLocalTasks.php | 4 +- .../thunder_article/thunder_article.module | 20 ++++++--- tests/src/Functional/ContentListTest.php | 23 ++++++++++ 4 files changed, 40 insertions(+), 50 deletions(-) diff --git a/modules/thunder_article/src/Form/ConfigurationForm.php b/modules/thunder_article/src/Form/ConfigurationForm.php index d92d4ed05..926b02417 100644 --- a/modules/thunder_article/src/Form/ConfigurationForm.php +++ b/modules/thunder_article/src/Form/ConfigurationForm.php @@ -2,54 +2,14 @@ namespace Drupal\thunder_article\Form; -use Drupal\Core\Cache\CacheBackendInterface; -use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Menu\LocalTaskManagerInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; /** * Class ConfigurationForm. */ class ConfigurationForm extends ConfigFormBase { - /** - * A local task manager instance. - * - * @var \Drupal\Core\Menu\LocalTaskManager - */ - protected $localTaskLinkManager; - - /** - * A cache backend interface instance. - * - * @var \Drupal\Core\Cache\CacheBackendInterface - */ - protected $cacheRender; - - /** - * {@inheritdoc} - */ - public function __construct(ConfigFactoryInterface $config_factory, LocalTaskManagerInterface $localTaskLinkManager, CacheBackendInterface $cacheRender) { - parent::__construct($config_factory); - $this->localTaskLinkManager = $localTaskLinkManager; - $this->cacheRender = $cacheRender; - - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('config.factory'), - $container->get('plugin.manager.menu.local_task'), - $container->get('cache.render') - - ); - } - /** * {@inheritdoc} */ @@ -91,9 +51,6 @@ public function submitForm(array &$form, FormStateInterface $form_state) { $this->config('thunder_article.settings') ->set('move_scheduler_local_task', $form_state->getValue('move_scheduler_local_task')) ->save(); - - $this->localTaskLinkManager->clearCachedDefinitions(); - $this->cacheRender->invalidateAll(); } } diff --git a/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php b/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php index 858089e75..ad3d7ff14 100644 --- a/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php +++ b/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php @@ -83,7 +83,9 @@ public function getDerivativeDefinitions($base_plugin_definition) { ] + $base_plugin_definition; } - if ($this->configFactory->get('thunder_article.settings')->get('move_scheduler_local_task') && $this->moduleHandler->moduleExists('scheduler') && $this->routeProvider->getRoutesByNames(['view.scheduler_scheduled_content.overview'])) { + if ($this->moduleHandler->moduleExists('scheduler') && $this->routeProvider->getRoutesByNames(['view.scheduler_scheduled_content.overview'])) { + // See thunder_article_menu_local_tasks_alter() for how this is displayed + // or not depending on configuration. $this->derivatives["thunder_article.scheduler"] = [ 'route_name' => "view.scheduler_scheduled_content.overview", 'title' => $this->t('Scheduled content'), diff --git a/modules/thunder_article/thunder_article.module b/modules/thunder_article/thunder_article.module index f7e4d1a8e..428a94fd2 100644 --- a/modules/thunder_article/thunder_article.module +++ b/modules/thunder_article/thunder_article.module @@ -5,6 +5,7 @@ * Thunder Article module hooks. */ +use Drupal\Core\Cache\Cache; use Drupal\Core\Form\FormStateInterface; /** @@ -40,12 +41,19 @@ function _thunder_article_form_alter_helper(array &$form, FormStateInterface $fo * Implements hook_menu_local_tasks_alter(). */ function thunder_article_menu_local_tasks_alter(&$data, $route_name) { - /** @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory */ - $config_factory = \Drupal::service('config.factory'); - if ($config_factory->get('thunder_article.settings')->get('move_scheduler_local_task')) { - foreach ($data['tabs'] as $key => $tab) { - if (!empty($tab['views_view:view.scheduler_scheduled_content.overview'])) { - unset($data['tabs'][$key]['views_view:view.scheduler_scheduled_content.overview']); + foreach ($data['tabs'] as $key => $tab) { + foreach ($tab as $task => $link) { + if ($task === 'views_view:view.scheduler_scheduled_content.overview') { + $config = \Drupal::service('config.factory')->get('thunder_article.settings'); + $link_ref = &$data['tabs'][$key][$task]; + $link_ref['#access'] = !$config->get('move_scheduler_local_task'); + $link_ref['#cache']['tags'] = Cache::mergeTags(isset($link_ref['#cache']['tags']) ? $link_ref['#cache']['tags'] : [], $config->getCacheTags()); + } + if ($task === 'thunder_article.content_view:thunder_article.scheduler') { + $config = \Drupal::service('config.factory')->get('thunder_article.settings'); + $link_ref = &$data['tabs'][$key][$task]; + $link_ref['#access'] = $config->get('move_scheduler_local_task'); + $link_ref['#cache']['tags'] = Cache::mergeTags(isset($link_ref['#cache']['tags']) ? $link_ref['#cache']['tags'] : [], $config->getCacheTags()); } } } diff --git a/tests/src/Functional/ContentListTest.php b/tests/src/Functional/ContentListTest.php index 56a8f47ba..c5d70809b 100644 --- a/tests/src/Functional/ContentListTest.php +++ b/tests/src/Functional/ContentListTest.php @@ -30,6 +30,7 @@ public function testSchedulerLocalTask() { $secondaryMenuBlockSelector = '#block-thunder-admin-secondary-local-tasks > nav > nav > ul'; $assert_session = $this->assertSession(); + $assert_session->elementTextNotContains('css', $primaryMenuBlockSelector, 'Scheduled'); $assert_session->elementTextContains('css', $secondaryMenuBlockSelector, 'Overview'); $assert_session->elementTextContains('css', $secondaryMenuBlockSelector, 'Scheduled content'); $assert_session->elementTextContains('css', $secondaryMenuBlockSelector, 'Locked content'); @@ -41,6 +42,28 @@ public function testSchedulerLocalTask() { $assert_session->elementTextNotContains('css', $secondaryMenuBlockSelector, 'Scheduled content'); $assert_session->elementTextContains('css', $primaryMenuBlockSelector, 'Scheduled'); $assert_session->elementTextContains('css', $secondaryMenuBlockSelector, 'Locked content'); + + $this->drupalPostForm('admin/config/thunder_article/configuration', ['move_scheduler_local_task' => 1], 'Save configuration'); + + $this->drupalGet('admin/content'); + + $assert_session->elementTextNotContains('css', $primaryMenuBlockSelector, 'Scheduled'); + $assert_session->elementTextContains('css', $secondaryMenuBlockSelector, 'Scheduled content'); + + $this->drupalPostForm('admin/config/thunder_article/configuration', ['move_scheduler_local_task' => 0], 'Save configuration'); + + $this->drupalGet('admin/content'); + + $assert_session->elementTextContains('css', $primaryMenuBlockSelector, 'Scheduled'); + $assert_session->elementTextNotContains('css', $secondaryMenuBlockSelector, 'Scheduled content'); + + // Uninstall the scheduler and the links should be gone. + $this->container->get('module_installer')->uninstall(['scheduler']); + $this->drupalGet('admin/content'); + + $assert_session->elementTextNotContains('css', $primaryMenuBlockSelector, 'Scheduled'); + $assert_session->elementTextNotContains('css', $secondaryMenuBlockSelector, 'Scheduled content'); + } } From 516dc4e958fe9eefe80723d54079ca5989c4952d Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Thu, 8 Mar 2018 16:47:37 +0000 Subject: [PATCH 052/134] Fix caching --- .../thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php b/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php index ad3d7ff14..15e63f3f2 100644 --- a/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php +++ b/modules/thunder_article/src/Plugin/Derivative/DynamicLocalTasks.php @@ -91,6 +91,7 @@ public function getDerivativeDefinitions($base_plugin_definition) { 'title' => $this->t('Scheduled content'), 'parent_id' => "system.admin_content", 'weight' => 3, + 'cache_tags' => $this->configFactory->get('thunder_article.settings')->getCacheTags(), ] + $base_plugin_definition; } From ef71d5051c2a98f88925981b02153a2d829ff786 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Thu, 8 Mar 2018 16:51:56 +0000 Subject: [PATCH 053/134] Less code and get to use a XOR --- modules/thunder_article/thunder_article.module | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/modules/thunder_article/thunder_article.module b/modules/thunder_article/thunder_article.module index 428a94fd2..a43314772 100644 --- a/modules/thunder_article/thunder_article.module +++ b/modules/thunder_article/thunder_article.module @@ -43,16 +43,11 @@ function _thunder_article_form_alter_helper(array &$form, FormStateInterface $fo function thunder_article_menu_local_tasks_alter(&$data, $route_name) { foreach ($data['tabs'] as $key => $tab) { foreach ($tab as $task => $link) { - if ($task === 'views_view:view.scheduler_scheduled_content.overview') { + $tabs = ['views_view:view.scheduler_scheduled_content.overview', 'thunder_article.content_view:thunder_article.scheduler']; + if (in_array($task, $tabs, TRUE)) { $config = \Drupal::service('config.factory')->get('thunder_article.settings'); $link_ref = &$data['tabs'][$key][$task]; - $link_ref['#access'] = !$config->get('move_scheduler_local_task'); - $link_ref['#cache']['tags'] = Cache::mergeTags(isset($link_ref['#cache']['tags']) ? $link_ref['#cache']['tags'] : [], $config->getCacheTags()); - } - if ($task === 'thunder_article.content_view:thunder_article.scheduler') { - $config = \Drupal::service('config.factory')->get('thunder_article.settings'); - $link_ref = &$data['tabs'][$key][$task]; - $link_ref['#access'] = $config->get('move_scheduler_local_task'); + $link_ref['#access'] = (($task === 'views_view:view.scheduler_scheduled_content.overview') xor $config->get('move_scheduler_local_task')); $link_ref['#cache']['tags'] = Cache::mergeTags(isset($link_ref['#cache']['tags']) ? $link_ref['#cache']['tags'] : [], $config->getCacheTags()); } } From c78182222e8b1a58907bd13d7021808bd32b524d Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Thu, 8 Mar 2018 16:56:45 +0000 Subject: [PATCH 054/134] Less brakcets --- modules/thunder_article/thunder_article.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/thunder_article/thunder_article.module b/modules/thunder_article/thunder_article.module index a43314772..016be6811 100644 --- a/modules/thunder_article/thunder_article.module +++ b/modules/thunder_article/thunder_article.module @@ -47,7 +47,7 @@ function thunder_article_menu_local_tasks_alter(&$data, $route_name) { if (in_array($task, $tabs, TRUE)) { $config = \Drupal::service('config.factory')->get('thunder_article.settings'); $link_ref = &$data['tabs'][$key][$task]; - $link_ref['#access'] = (($task === 'views_view:view.scheduler_scheduled_content.overview') xor $config->get('move_scheduler_local_task')); + $link_ref['#access'] = ($task === 'views_view:view.scheduler_scheduled_content.overview' xor $config->get('move_scheduler_local_task')); $link_ref['#cache']['tags'] = Cache::mergeTags(isset($link_ref['#cache']['tags']) ? $link_ref['#cache']['tags'] : [], $config->getCacheTags()); } } From 565b959afed73057f89da01b23ed51280a4267d3 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Thu, 8 Mar 2018 18:05:35 +0000 Subject: [PATCH 055/134] Do less in the loop and explain why \Drupal::service('config.factory')->get() is inside the loop --- modules/thunder_article/thunder_article.module | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/thunder_article/thunder_article.module b/modules/thunder_article/thunder_article.module index 016be6811..a4a962c5c 100644 --- a/modules/thunder_article/thunder_article.module +++ b/modules/thunder_article/thunder_article.module @@ -43,8 +43,9 @@ function _thunder_article_form_alter_helper(array &$form, FormStateInterface $fo function thunder_article_menu_local_tasks_alter(&$data, $route_name) { foreach ($data['tabs'] as $key => $tab) { foreach ($tab as $task => $link) { - $tabs = ['views_view:view.scheduler_scheduled_content.overview', 'thunder_article.content_view:thunder_article.scheduler']; - if (in_array($task, $tabs, TRUE)) { + if (in_array($task, ['views_view:view.scheduler_scheduled_content.overview', 'thunder_article.content_view:thunder_article.scheduler'], TRUE)) { + // Access configuration inside the loop so that we don't do unnecessary + // queries. $config = \Drupal::service('config.factory')->get('thunder_article.settings'); $link_ref = &$data['tabs'][$key][$task]; $link_ref['#access'] = ($task === 'views_view:view.scheduler_scheduled_content.overview' xor $config->get('move_scheduler_local_task')); From a77e1c9b3e64b8ec078ee877f575c601e02294b4 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Mon, 12 Mar 2018 13:46:30 +0100 Subject: [PATCH 056/134] Remove EB search api view --- composer.json | 2 +- drupal-org.make | 6 +- modules/thunder_media/thunder_media.module | 1 - .../optional/views.view.entity_browser.yml | 527 ------------------ 4 files changed, 4 insertions(+), 532 deletions(-) delete mode 100644 modules/thunder_search/config/optional/views.view.entity_browser.yml diff --git a/composer.json b/composer.json index d7270cda4..eab86bd4e 100644 --- a/composer.json +++ b/composer.json @@ -73,7 +73,7 @@ "Don't use network for loading logo information": "https://www.drupal.org/files/issues/amptheme-do_not_use_the_network_for_loading_logo_information-2753089-7.patch" }, "drupal/entity_browser": { - "Integrate editorial search with Search API module": "https://www.drupal.org/files/issues/2899254-combined.patch" + "Provide inline entity form FieldWidgetDisplay": "https://www.drupal.org/files/issues/2858438_6.patch" }, "drupal/search_api": { "Support entity 'operations' in Views": "https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch" diff --git a/drupal-org.make b/drupal-org.make index 8d2003400..5cc365f98 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -43,7 +43,7 @@ projects[entity][type] = module projects[entity][version] = 1 projects[entity_browser][type] = module projects[entity_browser][version] = 1.4 -projects[entity_browser][patch][] = https://www.drupal.org/files/issues/2899254-combined.patch +projects[entity_browser][patch][] = https://www.drupal.org/files/issues/2858438_6.patch projects[entity_reference_revisions][type] = module projects[entity_reference_revisions][version] = 1 projects[facets][type] = module @@ -102,7 +102,7 @@ projects[redirect][type] = module projects[redirect][version] = 1.0 projects[redirect][patch][] = https://www.drupal.org/files/issues/2932248-3.patch projects[search_api][type] = module -projects[search_api][version] = 1.6 +projects[search_api][version] = 1.7 projects[search_api][patch][] = https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch projects[scheduler][type] = module projects[scheduler][version] = 1 @@ -130,7 +130,7 @@ projects[infinite][type] = theme projects[infinite][download][url] = http://git.drupal.org/sandbox/gos77/2677750.git projects[infinite][download][tag] = 8.x-1.0-beta7 projects[views_bulk_operations][type] = module -projects[views_bulk_operations][version] = 1 +projects[views_bulk_operations][version] = 2 projects[video_embed_field][type] = module projects[video_embed_field][version] = 1 projects[views_load_more][type] = module diff --git a/modules/thunder_media/thunder_media.module b/modules/thunder_media/thunder_media.module index 82ccb7219..eef74f723 100644 --- a/modules/thunder_media/thunder_media.module +++ b/modules/thunder_media/thunder_media.module @@ -36,7 +36,6 @@ function thunder_media_file_create(File $entity) { function thunder_media_preprocess_views_view(&$variables) { $thunder_media_browser = [ - 'entity_browser', 'image_browser', 'video_browser', 'riddle_browser', diff --git a/modules/thunder_search/config/optional/views.view.entity_browser.yml b/modules/thunder_search/config/optional/views.view.entity_browser.yml deleted file mode 100644 index f22138af6..000000000 --- a/modules/thunder_search/config/optional/views.view.entity_browser.yml +++ /dev/null @@ -1,527 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - image.style.entity_browser_thumbnail - - search_api.index.content - module: - - entity_browser - - image - - search_api - - thunder_search - - user -id: entity_browser -label: entity_browser -module: views -description: '' -tag: '' -base_table: search_api_index_content -base_field: search_api_id -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content overview' - cache: - type: none - options: { } - query: - type: search_api_query - options: - bypass_access: false - skip_access: false - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: full - options: - items_per_page: 50 - offset: 0 - id: 0 - total_pages: null - tags: - previous: ‹‹ - next: ›› - first: '« First' - last: 'Last »' - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - quantity: 9 - style: - type: default - options: - grouping: { } - row_class: '' - default_row_class: true - row: - type: fields - fields: - thumbnail: - id: thumbnail - table: search_api_datasource_content_entity_media - field: thumbnail - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: image - settings: - image_style: entity_browser_thumbnail - image_link: '' - group_column: '' - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - field_rendering: true - fallback_handler: search_api - fallback_options: - link_to_item: false - multi_type: separator - multi_separator: ', ' - entity_type: media - plugin_id: search_api_field - name: - id: name - table: search_api_index_content - field: label - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '0' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - link_to_item: false - multi_type: separator - multi_separator: ', ' - plugin_id: search_api - type: - id: type - table: search_api_index_content - field: type - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: true - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - link_to_item: false - multi_type: separator - multi_separator: ', ' - plugin_id: search_api - entity_browser_select: - id: entity_browser_select - table: search_api_index_content - field: entity_browser_select - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - plugin_id: entity_browser_search_api_select - filters: - search_api_fulltext: - id: search_api_fulltext - table: search_api_index_content - field: search_api_fulltext - relationship: none - group_type: group - admin_label: '' - operator: and - value: '' - group: 1 - exposed: true - expose: - operator_id: search_api_fulltext_op - label: 'Fulltext search' - description: '' - use_operator: false - operator: search_api_fulltext_op - identifier: search_api_fulltext - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - editor: '0' - seo: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - parse_mode: terms - min_length: 3 - fields: { } - plugin_id: search_api_fulltext - search_api_language: - id: search_api_language - table: search_api_index_content - field: search_api_language - relationship: none - group_type: group - admin_label: '' - operator: in - value: - '***LANGUAGE_language_interface***': '***LANGUAGE_language_interface***' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: search_api_language - search_api_datasource: - id: search_api_datasource - table: search_api_index_content - field: search_api_datasource - relationship: none - group_type: group - admin_label: '' - operator: or - value: - 'entity:media': 'entity:media' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - reduce_duplicates: false - plugin_id: search_api_datasource - sorts: - search_api_relevance: - id: search_api_relevance - table: search_api_index_content - field: search_api_relevance - relationship: none - group_type: group - admin_label: '' - order: ASC - exposed: false - expose: - label: '' - plugin_id: search_api - title: Media - header: - result: - id: result - table: views - field: result - relationship: none - group_type: group - admin_label: '' - empty: false - content: 'Displaying @start - @end of @total' - plugin_id: result - facet_block: - id: facet_block - table: views - field: facet_block - relationship: none - group_type: group - admin_label: '' - empty: false - plugin_id: facet_block - footer: { } - empty: { } - relationships: { } - arguments: - type: - id: type - table: search_api_index_content - field: type - relationship: none - group_type: group - admin_label: '' - default_action: default - exception: - value: all - title_enable: false - title: All - title_enable: false - title: '' - default_argument_type: entity_browser_widget_context - default_argument_options: - context_key: target_bundles - fallback: all - multiple: or - default_argument_skip_url: false - summary_options: { } - summary: - sort_order: asc - number_of_records: 0 - format: default_summary - specify_validation: false - validate: - type: none - fail: 'not found' - validate_options: { } - break_phrase: false - not: false - plugin_id: search_api - display_extenders: { } - use_ajax: false - filter_groups: - operator: AND - groups: - 1: AND - css_class: view-media-entity-browser - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - tags: { } - entity_browser_1: - display_plugin: entity_browser - id: entity_browser_1 - display_title: 'Entity browser' - position: 2 - display_options: - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - tags: { } From efeaf52548daa8912acd85b49e16a1f203921b39 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 13 Mar 2018 10:00:31 +0100 Subject: [PATCH 057/134] Make search integration not enabled by default --- composer.json | 2 +- config/optional/views.view.content.yml | 2 +- drupal-org.make | 2 +- .../thunder_media/config/optional/views.view.thunder_media.yml | 2 +- src/Plugin/Thunder/OptionalModule/ThunderSearch.php | 1 - 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index eab86bd4e..78d1eb901 100644 --- a/composer.json +++ b/composer.json @@ -109,7 +109,7 @@ "drupal/diff": "1.0-rc1", "drupal/dropzonejs": "^1.0", "drupal/empty_fields": "^1.0", - "drupal/entity": "^1.0", + "drupal/entity": "1.0-beta1", "drupal/entity_browser": "1.4", "drupal/entity_reference_revisions": "^1.0", "drupal/fb_instant_articles": "dev-1.x", diff --git a/config/optional/views.view.content.yml b/config/optional/views.view.content.yml index 28b7f8f21..7e1baa1bb 100644 --- a/config/optional/views.view.content.yml +++ b/config/optional/views.view.content.yml @@ -1,5 +1,5 @@ langcode: en -status: false +status: true dependencies: config: - field.storage.node.field_channel diff --git a/drupal-org.make b/drupal-org.make index 5cc365f98..64474bc86 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -40,7 +40,7 @@ projects[dropzonejs][version] = 1 projects[empty_fields][type] = module projects[empty_fields][version] = 1 projects[entity][type] = module -projects[entity][version] = 1 +projects[entity][version] = 1.0-beta1 projects[entity_browser][type] = module projects[entity_browser][version] = 1.4 projects[entity_browser][patch][] = https://www.drupal.org/files/issues/2858438_6.patch diff --git a/modules/thunder_media/config/optional/views.view.thunder_media.yml b/modules/thunder_media/config/optional/views.view.thunder_media.yml index 145afebfd..8e7929f7d 100644 --- a/modules/thunder_media/config/optional/views.view.thunder_media.yml +++ b/modules/thunder_media/config/optional/views.view.thunder_media.yml @@ -1,5 +1,5 @@ langcode: en -status: false +status: true dependencies: config: - field.storage.media.field_expires diff --git a/src/Plugin/Thunder/OptionalModule/ThunderSearch.php b/src/Plugin/Thunder/OptionalModule/ThunderSearch.php index abc0ac438..f6cfe6306 100644 --- a/src/Plugin/Thunder/OptionalModule/ThunderSearch.php +++ b/src/Plugin/Thunder/OptionalModule/ThunderSearch.php @@ -10,7 +10,6 @@ * label = @Translation("Thunder Search integration"), * description = @Translation("Better search experience for editors and users"), * type = "module", - * standardlyEnabled = 1, * weight = -1 * ) */ From c03410ee2418f98d1874297a7dbbf1bdad1154c7 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 13 Mar 2018 10:23:07 +0100 Subject: [PATCH 058/134] Fix config test --- tests/src/Functional/InstalledConfigurationTest.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/src/Functional/InstalledConfigurationTest.php b/tests/src/Functional/InstalledConfigurationTest.php index 630d25d4b..59977d197 100644 --- a/tests/src/Functional/InstalledConfigurationTest.php +++ b/tests/src/Functional/InstalledConfigurationTest.php @@ -167,13 +167,19 @@ class InstalledConfigurationTest extends ThunderBaseTest { 'register' => TRUE, ], - // Media view status is changed by Thunder Install hook. + // View status is changed by Thunder Install hook. 'views.view.media' => [ 'dependencies' => [ 'config' => TRUE, ], 'status' => TRUE, ], + 'views.view.thunder_media' => [ + 'status' => TRUE, + ], + 'views.view.content' => [ + 'status' => TRUE, + ], // Changed on installation. 'views.view.glossary' => [ From 64c84ac9441805206ce0e3427c5b01da8b940b6a Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 13 Mar 2018 13:28:44 +0100 Subject: [PATCH 059/134] Add tests --- modules/thunder_search/thunder_search.install | 13 +++++ .../Integration/ConfigSelectorTest.php | 49 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 modules/thunder_search/thunder_search.install create mode 100644 tests/src/Functional/Integration/ConfigSelectorTest.php diff --git a/modules/thunder_search/thunder_search.install b/modules/thunder_search/thunder_search.install new file mode 100644 index 000000000..6a1a91cef --- /dev/null +++ b/modules/thunder_search/thunder_search.install @@ -0,0 +1,13 @@ +logWithRole('administrator'); + + $assert_session = $this->assertSession(); + + // Content lock fields are there by default. + $this->drupalGet('admin/content'); + $assert_session->elementExists('xpath', '//*[@id="view-title-table-column"]/a'); + $assert_session->elementExists('css', '#block-thunder-admin-content > div > div.view-content'); + + // Install thunder_search. + $this->drupalPostForm('admin/modules', ['modules[thunder_search][enable]' => 1], 'Install'); + $this->click('#edit-submit'); + + // Now we have a search_api based view. + $this->drupalGet('admin/content'); + $assert_session->elementExists('xpath', '//*[@id="view-label-table-column"]/a'); + $assert_session->elementExists('css', '#block-thunder-admin-content > div > div.view-content-search-api'); + + // Uninstall search_api. + $this->drupalPostForm('admin/modules/uninstall', ['uninstall[thunder_search]' => 1, 'uninstall[search_api]' => 1], 'Uninstall'); + $this->click('#edit-submit'); + + // The normal view is back. + $this->drupalGet('admin/content'); + $assert_session->elementExists('xpath', '//*[@id="view-title-table-column"]/a'); + $assert_session->elementExists('css', '#block-thunder-admin-content > div > div.view-content'); + } + +} From ea686acfaaf33fd1e5c4a2c88260b42bee067cb7 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 13 Mar 2018 13:53:20 +0100 Subject: [PATCH 060/134] [TEST_UPDATE=true] Trigger update test path --- ...r_add_config_selector_to_content_media.yml | 16 ++++++++++++++++ modules/thunder_updater/updates.yml | 4 ++++ thunder.post_update.php | 19 +++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 config/update/thunder_add_config_selector_to_content_media.yml diff --git a/config/update/thunder_add_config_selector_to_content_media.yml b/config/update/thunder_add_config_selector_to_content_media.yml new file mode 100644 index 000000000..8d863aa58 --- /dev/null +++ b/config/update/thunder_add_config_selector_to_content_media.yml @@ -0,0 +1,16 @@ +views.view.content: + expected_config: { } + update_actions: + add: + third_party_settings: + config_selector: + feature: thunder_content_view + priority: 0 +views.view.thunder_media: + expected_config: { } + update_actions: + add: + third_party_settings: + config_selector: + feature: thunder_media_view + priority: 0 diff --git a/modules/thunder_updater/updates.yml b/modules/thunder_updater/updates.yml index 737447caa..45efbb76c 100644 --- a/modules/thunder_updater/updates.yml +++ b/modules/thunder_updater/updates.yml @@ -209,3 +209,7 @@ v2.16: '#description_successful': '

The installation was successful.

' '#description_failed': '

Installation failed

' thunder_article_config: { '#text': 'Move scheduler link back from local tasks to menu tab', '#url': 'internal:/admin/config/thunder_article/configuration' } + thunder_add_config_selector_to_content_media: + '#title': 'Add config_selector settings to content and media view' + '#description': '

Configuration is successfully updated.

' + '#description_failed': '

Update of configuration has failed.

' diff --git a/thunder.post_update.php b/thunder.post_update.php index 4730c7cff..4e709de0f 100644 --- a/thunder.post_update.php +++ b/thunder.post_update.php @@ -22,3 +22,22 @@ function thunder_post_update_ensure_config_selector_installed() { // Output logged messages to related channel of update execution. return $thunderUpdater->logger()->output(); } + +/** + * Add config_selector settings to content and media view. + */ +function thunder_post_update_add_config_selector_to_content_media() { + /** @var \Drupal\thunder_updater\Updater $thunderUpdater */ + $thunderUpdater = \Drupal::service('thunder_updater'); + + // Execute configuration update definitions with logging of success. + if ($thunderUpdater->executeUpdates([['thunder', 'thunder_add_config_selector_to_content_media']])) { + $thunderUpdater->checklist()->markUpdatesSuccessful(['thunder_add_config_selector_to_content_media']); + } + else { + $thunderUpdater->checklist()->markUpdatesFailed(['thunder_add_config_selector_to_content_media']); + } + + // Output logged messages to related channel of update execution. + return $thunderUpdater->logger()->output(); +} From 5ddb00545f3e357a6bead499c488bb09cbbc64ab Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 13 Mar 2018 14:00:22 +0100 Subject: [PATCH 061/134] [TEST_UPDATE=true] Trigger update test path --- thunder.post_update.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/thunder.post_update.php b/thunder.post_update.php index 4e709de0f..c6f4ec822 100644 --- a/thunder.post_update.php +++ b/thunder.post_update.php @@ -5,6 +5,8 @@ * Post update functions for Thunder. */ +use Drupal\views\Entity\View; + /** * Install the Configuration Selector module if necessary. */ @@ -32,6 +34,8 @@ function thunder_post_update_add_config_selector_to_content_media() { // Execute configuration update definitions with logging of success. if ($thunderUpdater->executeUpdates([['thunder', 'thunder_add_config_selector_to_content_media']])) { + View::load('content')->save(); + View::load('thunder_media')->save(); $thunderUpdater->checklist()->markUpdatesSuccessful(['thunder_add_config_selector_to_content_media']); } else { From c2c4d5fd04a519c3bff45a9c10ca6f37b6568a66 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 14 Mar 2018 16:09:11 +0100 Subject: [PATCH 062/134] Add config_selector UI --- composer.json | 3 +++ .../config_selector.feature.thunder_content_view.yml | 9 +++++++++ .../config_selector.feature.thunder_media_view.yml | 9 +++++++++ drupal-org.make | 1 + thunder.post_update.php | 4 ++++ 5 files changed, 26 insertions(+) create mode 100644 config/install/config_selector.feature.thunder_content_view.yml create mode 100644 config/install/config_selector.feature.thunder_media_view.yml diff --git a/composer.json b/composer.json index 78d1eb901..290115110 100644 --- a/composer.json +++ b/composer.json @@ -80,6 +80,9 @@ }, "drupal/redirect": { "Provided config does not match the config after an export": "https://www.drupal.org/files/issues/2932248-3.patch" + }, + "drupal/config_selector": { + "Add a user interface so that users can administer features": "https://www.drupal.org/files/issues/2948788-2.patch" } } }, diff --git a/config/install/config_selector.feature.thunder_content_view.yml b/config/install/config_selector.feature.thunder_content_view.yml new file mode 100644 index 000000000..40f0acb74 --- /dev/null +++ b/config/install/config_selector.feature.thunder_content_view.yml @@ -0,0 +1,9 @@ +langcode: en +status: true +dependencies: + enforced: + module: + - config_selector +id: thunder_content_view +label: 'Content view' +description: 'The main view for editing content' diff --git a/config/install/config_selector.feature.thunder_media_view.yml b/config/install/config_selector.feature.thunder_media_view.yml new file mode 100644 index 000000000..b66948d64 --- /dev/null +++ b/config/install/config_selector.feature.thunder_media_view.yml @@ -0,0 +1,9 @@ +langcode: en +status: true +dependencies: + enforced: + module: + - config_selector +id: thunder_media_view +label: 'Media view' +description: 'The main view for editing media items' diff --git a/drupal-org.make b/drupal-org.make index 64474bc86..152826dba 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -22,6 +22,7 @@ projects[checklistapi][type] = module projects[checklistapi][version] = 1 projects[config_selector][type] = module projects[config_selector][version] = 1 +projects[config_selector][patch][] = https://www.drupal.org/files/issues/2948788-2.patch projects[config_update][type] = module projects[config_update][version] = 1 projects[content_lock][type] = module diff --git a/thunder.post_update.php b/thunder.post_update.php index c6f4ec822..ed043d08d 100644 --- a/thunder.post_update.php +++ b/thunder.post_update.php @@ -36,6 +36,10 @@ function thunder_post_update_add_config_selector_to_content_media() { if ($thunderUpdater->executeUpdates([['thunder', 'thunder_add_config_selector_to_content_media']])) { View::load('content')->save(); View::load('thunder_media')->save(); + /** @var \Drupal\config_update\ConfigReverter $configReverter */ + $configReverter = \Drupal::service('config_update.config_update'); + $configReverter->import('config_selector_feature', 'thunder_content_view'); + $configReverter->import('config_selector_feature', 'thunder_media_view'); $thunderUpdater->checklist()->markUpdatesSuccessful(['thunder_add_config_selector_to_content_media']); } else { From 778eebfeaeb172c6e928cc70b9846ab503f3da63 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 15 Mar 2018 16:36:46 +0100 Subject: [PATCH 063/134] Add channel faces, update config_selector --- composer.json | 2 +- drupal-org.make | 2 +- .../config/optional/facets.facet.channel.yml | 65 +++++++++++++++++++ .../optional/search_api.index.content.yml | 10 ++- .../views.view.content_search_api.yml | 22 +++---- 5 files changed, 83 insertions(+), 18 deletions(-) create mode 100644 modules/thunder_search/config/optional/facets.facet.channel.yml diff --git a/composer.json b/composer.json index 0c5b4c05e..f228dea45 100644 --- a/composer.json +++ b/composer.json @@ -82,7 +82,7 @@ "Provided config does not match the config after an export": "https://www.drupal.org/files/issues/2932248-3.patch" }, "drupal/config_selector": { - "Add a user interface so that users can administer features": "https://www.drupal.org/files/issues/2948788-2.patch" + "Add a user interface so that users can administer features": "https://www.drupal.org/files/issues/2018-03-14/2948788-9.patch" } } }, diff --git a/drupal-org.make b/drupal-org.make index cdb9bab3d..b13b8e82b 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -22,7 +22,7 @@ projects[checklistapi][type] = module projects[checklistapi][version] = 1 projects[config_selector][type] = module projects[config_selector][version] = 1 -projects[config_selector][patch][] = https://www.drupal.org/files/issues/2948788-2.patch +projects[config_selector][patch][] = https://www.drupal.org/files/issues/2018-03-14/2948788-9.patch projects[config_update][type] = module projects[config_update][version] = 1 projects[content_lock][type] = module diff --git a/modules/thunder_search/config/optional/facets.facet.channel.yml b/modules/thunder_search/config/optional/facets.facet.channel.yml new file mode 100644 index 000000000..123e294c7 --- /dev/null +++ b/modules/thunder_search/config/optional/facets.facet.channel.yml @@ -0,0 +1,65 @@ +langcode: en +status: true +dependencies: + config: + - search_api.index.content + - views.view.content_search_api + module: + - search_api +id: channel +name: Channel +url_alias: channel +weight: 0 +min_count: 0 +show_only_one_result: true +field_identifier: field_channel +facet_source_id: 'search_api:views_page__content_search_api__page_1' +widget: + type: dropdown + config: + show_numbers: false + default_option_label: Choose +query_operator: or +use_hierarchy: true +expand_hierarchy: true +enable_parent_when_child_gets_disabled: true +hard_limit: 0 +exclude: false +only_visible_when_facet_source_is_visible: true +processor_configs: + active_widget_order: + processor_id: active_widget_order + weights: + sort: -10 + settings: + sort: DESC + count_widget_order: + processor_id: count_widget_order + weights: + sort: -10 + settings: + sort: DESC + display_value_widget_order: + processor_id: display_value_widget_order + weights: + sort: -10 + settings: + sort: ASC + hide_1_result_facet: + processor_id: hide_1_result_facet + weights: + build: -10 + settings: { } + translate_entity: + processor_id: translate_entity + weights: + build: 5 + settings: { } + url_processor_handler: + processor_id: url_processor_handler + weights: + pre_query: -10 + build: -10 + settings: { } +empty_behavior: + behavior: none diff --git a/modules/thunder_search/config/optional/search_api.index.content.yml b/modules/thunder_search/config/optional/search_api.index.content.yml index fc8706583..f7c3d9fca 100644 --- a/modules/thunder_search/config/optional/search_api.index.content.yml +++ b/modules/thunder_search/config/optional/search_api.index.content.yml @@ -181,8 +181,6 @@ processor_settings: h3: 2 strong: 2 b: 2 - em: 1 - u: 1 weights: preprocess_index: -15 preprocess_query: -15 @@ -261,6 +259,14 @@ processor_settings: - type - name - media_author + weights: + preprocess_index: -20 + preprocess_query: -20 + hierarchy: + fields: + field_channel: taxonomy_term-parent + weights: + preprocess_index: -45 tracker_settings: default: indexing_order: fifo diff --git a/modules/thunder_search/config/optional/views.view.content_search_api.yml b/modules/thunder_search/config/optional/views.view.content_search_api.yml index 0cd36c6e9..e9a26fb11 100644 --- a/modules/thunder_search/config/optional/views.view.content_search_api.yml +++ b/modules/thunder_search/config/optional/views.view.content_search_api.yml @@ -7,24 +7,24 @@ dependencies: - image.style.thumbnail - search_api.index.content module: + - config_selector - media_entity - search_api - thunder_search - user - views_bulk_operations - - config_selector +third_party_settings: + config_selector: + feature: thunder_content_view + priority: 1 id: content_search_api -label: Content +label: 'Content - Search API' module: views -description: '' +description: 'Find and manage content with an advanced search technology.' tag: '' base_table: search_api_index_content base_field: search_api_id core: 8.x -third_party_settings: - config_selector: - feature: thunder_content_view - priority: 1 display: default: display_plugin: default @@ -93,7 +93,6 @@ display: type: type field_channel: field_channel status: status - publish_on: publish_on node_changed: node_changed search_api_operations: search_api_operations info: @@ -122,7 +121,7 @@ display: empty_column: false responsive: priority-medium field_channel: - sortable: false + sortable: true default_sort_order: asc align: '' separator: '' @@ -135,11 +134,6 @@ display: separator: '' empty_column: false responsive: priority-medium - publish_on: - align: '' - separator: '' - empty_column: false - responsive: priority-low node_changed: sortable: true default_sort_order: desc From e56a4f8e13851e1759825684749bde446d81ecb2 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 5 Apr 2018 11:38:11 +0200 Subject: [PATCH 064/134] Fix CS --- thunder.post_update.php | 1 - 1 file changed, 1 deletion(-) diff --git a/thunder.post_update.php b/thunder.post_update.php index 3da323647..ee8732508 100644 --- a/thunder.post_update.php +++ b/thunder.post_update.php @@ -31,4 +31,3 @@ function thunder_post_update_add_config_selector_to_content_media() { // Output logged messages to related channel of update execution. return $thunderUpdater->logger()->output(); } - From 84242e86a95289b3e18c6ca04dbd57beddbad1d0 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Mon, 23 Apr 2018 09:54:10 +0200 Subject: [PATCH 065/134] Adding descriptions --- .../config/optional/views.view.thunder_media.yml | 2 +- .../config/optional/views.view.media_search_api.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/thunder_media/config/optional/views.view.thunder_media.yml b/modules/thunder_media/config/optional/views.view.thunder_media.yml index 8e7929f7d..7cb13db2d 100644 --- a/modules/thunder_media/config/optional/views.view.thunder_media.yml +++ b/modules/thunder_media/config/optional/views.view.thunder_media.yml @@ -13,7 +13,7 @@ dependencies: id: thunder_media label: Media module: views -description: '' +description: 'Find and manage media.' tag: '' base_table: media_field_data base_field: mid diff --git a/modules/thunder_search/config/optional/views.view.media_search_api.yml b/modules/thunder_search/config/optional/views.view.media_search_api.yml index 8051c1407..f59e40e3f 100644 --- a/modules/thunder_search/config/optional/views.view.media_search_api.yml +++ b/modules/thunder_search/config/optional/views.view.media_search_api.yml @@ -14,9 +14,9 @@ dependencies: - views_bulk_operations - config_selector id: media_search_api -label: Media +label: 'Media - Search API' module: views -description: '' +description: 'Find and manage media with an advanced search technology.' tag: '' base_table: search_api_index_content base_field: search_api_id From 0107f18c931432c9b22ac4f5d338b3585940b0c4 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 2 Aug 2018 13:35:23 +0200 Subject: [PATCH 066/134] Fix configs --- modules/thunder_search/config/optional/facets.facet.author.yml | 1 + modules/thunder_search/config/optional/facets.facet.channel.yml | 1 + .../config/optional/facets.facet.media_status.yml | 1 + .../thunder_search/config/optional/facets.facet.media_type.yml | 1 + .../config/optional/facets.facet.promoted_to_front_page.yml | 1 + .../config/optional/facets.facet.publishing_status.yml | 1 + modules/thunder_search/config/optional/facets.facet.status.yml | 1 + .../config/optional/facets.facet.sticky_at_top_of_lists.yml | 1 + modules/thunder_search/config/optional/facets.facet.type.yml | 1 + modules/thunder_search/src/Plugin/views/area/FacetBlock.php | 2 +- 10 files changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/thunder_search/config/optional/facets.facet.author.yml b/modules/thunder_search/config/optional/facets.facet.author.yml index 94754c573..bc0f57cc6 100644 --- a/modules/thunder_search/config/optional/facets.facet.author.yml +++ b/modules/thunder_search/config/optional/facets.facet.author.yml @@ -63,3 +63,4 @@ processor_configs: settings: { } empty_behavior: behavior: none +show_title: null diff --git a/modules/thunder_search/config/optional/facets.facet.channel.yml b/modules/thunder_search/config/optional/facets.facet.channel.yml index 123e294c7..7a481f755 100644 --- a/modules/thunder_search/config/optional/facets.facet.channel.yml +++ b/modules/thunder_search/config/optional/facets.facet.channel.yml @@ -63,3 +63,4 @@ processor_configs: settings: { } empty_behavior: behavior: none +show_title: null diff --git a/modules/thunder_search/config/optional/facets.facet.media_status.yml b/modules/thunder_search/config/optional/facets.facet.media_status.yml index 30e5b3423..bfea95270 100644 --- a/modules/thunder_search/config/optional/facets.facet.media_status.yml +++ b/modules/thunder_search/config/optional/facets.facet.media_status.yml @@ -65,3 +65,4 @@ processor_configs: settings: { } empty_behavior: behavior: none +show_title: null diff --git a/modules/thunder_search/config/optional/facets.facet.media_type.yml b/modules/thunder_search/config/optional/facets.facet.media_type.yml index 1813ee9bd..6862ba249 100644 --- a/modules/thunder_search/config/optional/facets.facet.media_type.yml +++ b/modules/thunder_search/config/optional/facets.facet.media_type.yml @@ -63,3 +63,4 @@ processor_configs: settings: { } empty_behavior: behavior: none +show_title: null diff --git a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml index 40023495f..6c517cbed 100644 --- a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml +++ b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml @@ -65,3 +65,4 @@ processor_configs: settings: { } empty_behavior: behavior: none +show_title: null diff --git a/modules/thunder_search/config/optional/facets.facet.publishing_status.yml b/modules/thunder_search/config/optional/facets.facet.publishing_status.yml index 83faa9817..e89491017 100644 --- a/modules/thunder_search/config/optional/facets.facet.publishing_status.yml +++ b/modules/thunder_search/config/optional/facets.facet.publishing_status.yml @@ -65,3 +65,4 @@ processor_configs: settings: { } empty_behavior: behavior: none +show_title: null diff --git a/modules/thunder_search/config/optional/facets.facet.status.yml b/modules/thunder_search/config/optional/facets.facet.status.yml index 0857bd015..a8bf7ed11 100644 --- a/modules/thunder_search/config/optional/facets.facet.status.yml +++ b/modules/thunder_search/config/optional/facets.facet.status.yml @@ -65,3 +65,4 @@ processor_configs: settings: { } empty_behavior: behavior: none +show_title: null diff --git a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml index 080b3e13b..0dc588c2f 100644 --- a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml +++ b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml @@ -65,3 +65,4 @@ processor_configs: settings: { } empty_behavior: behavior: none +show_title: null diff --git a/modules/thunder_search/config/optional/facets.facet.type.yml b/modules/thunder_search/config/optional/facets.facet.type.yml index d60056c13..57999b575 100644 --- a/modules/thunder_search/config/optional/facets.facet.type.yml +++ b/modules/thunder_search/config/optional/facets.facet.type.yml @@ -58,3 +58,4 @@ processor_configs: settings: { } empty_behavior: behavior: none +show_title: null diff --git a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php index ac3268536..f48b65236 100644 --- a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php +++ b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php @@ -36,7 +36,7 @@ public function render($empty = FALSE) { if ($config['view_id'] == $this->view->id() && $config['view_display'] == $this->view->current_display) { $built_facet = $facetManager->build($facet); - if ($built_facet) { + if (isset($built_facet[0]['#theme'])) { $build[$id] = [ '#type' => 'container', '#attributes' => ['class' => 'form-item'], From ae259a6dae2204c7f3cf110fc65078532e5c8d47 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 19 Sep 2018 11:31:43 +0200 Subject: [PATCH 067/134] Update search api --- composer.json | 2 +- drupal-org.make | 2 +- .../src/Plugin/views/area/FacetBlock.php | 24 +++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index fd171fd18..86c7e2f6a 100644 --- a/composer.json +++ b/composer.json @@ -131,7 +131,7 @@ "drupal/redirect": "^1.0", "drupal/riddle_marketplace": "^2.0", "drupal/scheduler": "^1.0", - "drupal/search_api": "1.7", + "drupal/search_api": "1.10", "drupal/select2": "^1.0", "drupal/simple_sitemap": "^2.0", "drupal/shariff": "^1.0", diff --git a/drupal-org.make b/drupal-org.make index 5fecb2d14..e2890d095 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -101,7 +101,7 @@ projects[riddle_marketplace][version] = 2 projects[redirect][type] = module projects[redirect][version] = 1 projects[search_api][type] = module -projects[search_api][version] = 1.7 +projects[search_api][version] = 1.10 projects[search_api][patch][] = https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch projects[scheduler][type] = module projects[scheduler][version] = 1 diff --git a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php index f48b65236..0ede4db88 100644 --- a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php +++ b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php @@ -23,6 +23,7 @@ public function render($empty = FALSE) { ->getStorage('facets_facet') ->loadMultiple(); + /** @var \Drupal\facets\FacetManager\DefaultFacetManager $facetManager */ $facetManager = \Drupal::service('facets.manager'); $build = ['#type' => 'container', '#attributes' => ['class' => 'form--inline clearfix']]; $build['_view'] = $this->view->display_handler->viewExposedFormBlocks(); @@ -36,18 +37,17 @@ public function render($empty = FALSE) { if ($config['view_id'] == $this->view->id() && $config['view_display'] == $this->view->current_display) { $built_facet = $facetManager->build($facet); - if (isset($built_facet[0]['#theme'])) { - $build[$id] = [ - '#type' => 'container', - '#attributes' => ['class' => 'form-item'], - 'label' => [ - '#type' => 'label', - '#title' => $facet->label(), - '#title_display' => 'above', - ], - 'element' => $built_facet, - ]; - } + $build[$id] = [ + '#type' => 'container', + '#attributes' => ['class' => 'form-item'], + 'label' => [ + '#type' => 'label', + '#title' => $facet->label(), + '#title_display' => 'above', + ], + 'element' => $built_facet, + ]; + } } From df2d353dafde4011d50c5a02afb6c4c2c03a1e46 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 20 Sep 2018 09:34:09 +0200 Subject: [PATCH 068/134] Use select2 widget --- .../config/optional/facets.facet.author.yml | 5 ++-- .../config/optional/facets.facet.channel.yml | 5 ++-- .../optional/facets.facet.media_status.yml | 5 ++-- .../optional/facets.facet.media_type.yml | 5 ++-- .../facets.facet.promoted_to_front_page.yml | 5 ++-- .../facets.facet.publishing_status.yml | 5 ++-- .../config/optional/facets.facet.status.yml | 5 ++-- .../facets.facet.sticky_at_top_of_lists.yml | 5 ++-- .../config/optional/facets.facet.type.yml | 5 ++-- .../src/Plugin/views/area/FacetBlock.php | 25 ++++++++++--------- 10 files changed, 31 insertions(+), 39 deletions(-) diff --git a/modules/thunder_search/config/optional/facets.facet.author.yml b/modules/thunder_search/config/optional/facets.facet.author.yml index bc0f57cc6..6beccc633 100644 --- a/modules/thunder_search/config/optional/facets.facet.author.yml +++ b/modules/thunder_search/config/optional/facets.facet.author.yml @@ -15,10 +15,9 @@ show_only_one_result: true field_identifier: uid facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: - type: dropdown + type: select2 config: show_numbers: false - default_option_label: Choose query_operator: or use_hierarchy: false expand_hierarchy: false @@ -63,4 +62,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: null +show_title: false diff --git a/modules/thunder_search/config/optional/facets.facet.channel.yml b/modules/thunder_search/config/optional/facets.facet.channel.yml index 7a481f755..f2354d674 100644 --- a/modules/thunder_search/config/optional/facets.facet.channel.yml +++ b/modules/thunder_search/config/optional/facets.facet.channel.yml @@ -15,10 +15,9 @@ show_only_one_result: true field_identifier: field_channel facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: - type: dropdown + type: select2 config: show_numbers: false - default_option_label: Choose query_operator: or use_hierarchy: true expand_hierarchy: true @@ -63,4 +62,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: null +show_title: false diff --git a/modules/thunder_search/config/optional/facets.facet.media_status.yml b/modules/thunder_search/config/optional/facets.facet.media_status.yml index bfea95270..8f7126b2c 100644 --- a/modules/thunder_search/config/optional/facets.facet.media_status.yml +++ b/modules/thunder_search/config/optional/facets.facet.media_status.yml @@ -15,10 +15,9 @@ show_only_one_result: true field_identifier: media_status facet_source_id: 'search_api:views_page__media_search_api__page_1' widget: - type: dropdown + type: select2 config: show_numbers: false - default_option_label: Choose query_operator: or use_hierarchy: false expand_hierarchy: false @@ -65,4 +64,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: null +show_title: false diff --git a/modules/thunder_search/config/optional/facets.facet.media_type.yml b/modules/thunder_search/config/optional/facets.facet.media_type.yml index 6862ba249..74f95066d 100644 --- a/modules/thunder_search/config/optional/facets.facet.media_type.yml +++ b/modules/thunder_search/config/optional/facets.facet.media_type.yml @@ -15,10 +15,9 @@ show_only_one_result: true field_identifier: type facet_source_id: 'search_api:views_page__media_search_api__page_1' widget: - type: dropdown + type: select2 config: show_numbers: false - default_option_label: Choose query_operator: or use_hierarchy: false expand_hierarchy: false @@ -63,4 +62,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: null +show_title: false diff --git a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml index 6c517cbed..4e54baffc 100644 --- a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml +++ b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml @@ -15,10 +15,9 @@ show_only_one_result: true field_identifier: promote facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: - type: dropdown + type: select2 config: show_numbers: false - default_option_label: Choose query_operator: or use_hierarchy: false expand_hierarchy: false @@ -65,4 +64,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: null +show_title: false diff --git a/modules/thunder_search/config/optional/facets.facet.publishing_status.yml b/modules/thunder_search/config/optional/facets.facet.publishing_status.yml index e89491017..68d5ba0ed 100644 --- a/modules/thunder_search/config/optional/facets.facet.publishing_status.yml +++ b/modules/thunder_search/config/optional/facets.facet.publishing_status.yml @@ -15,10 +15,9 @@ show_only_one_result: true field_identifier: media_status facet_source_id: 'search_api:views_page__media_search_api__page_1' widget: - type: dropdown + type: select2 config: show_numbers: false - default_option_label: Choose query_operator: or use_hierarchy: false expand_hierarchy: false @@ -65,4 +64,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: null +show_title: false diff --git a/modules/thunder_search/config/optional/facets.facet.status.yml b/modules/thunder_search/config/optional/facets.facet.status.yml index a8bf7ed11..1498d87c0 100644 --- a/modules/thunder_search/config/optional/facets.facet.status.yml +++ b/modules/thunder_search/config/optional/facets.facet.status.yml @@ -15,10 +15,9 @@ show_only_one_result: true field_identifier: status facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: - type: dropdown + type: select2 config: show_numbers: false - default_option_label: Choose query_operator: or use_hierarchy: false expand_hierarchy: false @@ -65,4 +64,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: null +show_title: false diff --git a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml index 0dc588c2f..d9a936ad4 100644 --- a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml +++ b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml @@ -15,10 +15,9 @@ show_only_one_result: true field_identifier: sticky facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: - type: dropdown + type: select2 config: show_numbers: false - default_option_label: Choose query_operator: or use_hierarchy: false expand_hierarchy: false @@ -65,4 +64,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: null +show_title: false diff --git a/modules/thunder_search/config/optional/facets.facet.type.yml b/modules/thunder_search/config/optional/facets.facet.type.yml index 57999b575..3b1587c71 100644 --- a/modules/thunder_search/config/optional/facets.facet.type.yml +++ b/modules/thunder_search/config/optional/facets.facet.type.yml @@ -15,10 +15,9 @@ show_only_one_result: true field_identifier: type facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: - type: dropdown + type: select2 config: show_numbers: false - default_option_label: Choose query_operator: or use_hierarchy: false expand_hierarchy: false @@ -58,4 +57,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: null +show_title: false diff --git a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php index 0ede4db88..68cfc4399 100644 --- a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php +++ b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php @@ -29,7 +29,7 @@ public function render($empty = FALSE) { $build['_view'] = $this->view->display_handler->viewExposedFormBlocks(); foreach ($facets as $id => $facet) { // No need to build the facet if it does not need to be visible. - if ($facet->getOnlyVisibleWhenFacetSourceIsVisible() && !$facet->getFacetSource()->isRenderedInCurrentRequest()) { + if (($facet->getOnlyVisibleWhenFacetSourceIsVisible() && !$facet->getFacetSource()->isRenderedInCurrentRequest())) { continue; } @@ -37,17 +37,18 @@ public function render($empty = FALSE) { if ($config['view_id'] == $this->view->id() && $config['view_display'] == $this->view->current_display) { $built_facet = $facetManager->build($facet); - $build[$id] = [ - '#type' => 'container', - '#attributes' => ['class' => 'form-item'], - 'label' => [ - '#type' => 'label', - '#title' => $facet->label(), - '#title_display' => 'above', - ], - 'element' => $built_facet, - ]; - + if (!in_array('facet-empty', $built_facet[0]['#attributes']['class'])) { + $build[$id] = [ + '#type' => 'container', + '#attributes' => ['class' => 'form-item'], + 'label' => [ + '#type' => 'label', + '#title' => $facet->label(), + '#title_display' => 'above', + ], + 'element' => $built_facet, + ]; + } } } From badfa1db7135b8a116a4db3907fee667a8e0db90 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 4 Oct 2018 09:42:50 +0200 Subject: [PATCH 069/134] Add tags facet --- .../config/optional/facets.facet.tags.yml | 65 ++++ .../optional/search_api.index.content.yml | 334 ++++++++++-------- .../thunder_search/thunder_search.info.yml | 1 + 3 files changed, 253 insertions(+), 147 deletions(-) create mode 100644 modules/thunder_search/config/optional/facets.facet.tags.yml diff --git a/modules/thunder_search/config/optional/facets.facet.tags.yml b/modules/thunder_search/config/optional/facets.facet.tags.yml new file mode 100644 index 000000000..30167c84c --- /dev/null +++ b/modules/thunder_search/config/optional/facets.facet.tags.yml @@ -0,0 +1,65 @@ +langcode: en +status: true +dependencies: + config: + - search_api.index.content + - views.view.content_search_api + module: + - search_api +id: tags +name: Tags +url_alias: tags +weight: 0 +min_count: 1 +show_only_one_result: false +field_identifier: field_tags +facet_source_id: 'search_api:views_page__content_search_api__page_1' +widget: + type: select2 + config: + show_numbers: false +query_operator: or +use_hierarchy: true +expand_hierarchy: true +enable_parent_when_child_gets_disabled: true +hard_limit: 0 +exclude: false +only_visible_when_facet_source_is_visible: true +processor_configs: + active_widget_order: + processor_id: active_widget_order + weights: + sort: 20 + settings: + sort: DESC + count_widget_order: + processor_id: count_widget_order + weights: + sort: 30 + settings: + sort: DESC + display_value_widget_order: + processor_id: display_value_widget_order + weights: + sort: 40 + settings: + sort: ASC + hide_1_result_facet: + processor_id: hide_1_result_facet + weights: + build: 50 + settings: { } + translate_entity: + processor_id: translate_entity + weights: + build: 5 + settings: { } + url_processor_handler: + processor_id: url_processor_handler + weights: + pre_query: 50 + build: 15 + settings: { } +empty_behavior: + behavior: none +show_title: false diff --git a/modules/thunder_search/config/optional/search_api.index.content.yml b/modules/thunder_search/config/optional/search_api.index.content.yml index f7c3d9fca..000345c0c 100644 --- a/modules/thunder_search/config/optional/search_api.index.content.yml +++ b/modules/thunder_search/config/optional/search_api.index.content.yml @@ -2,19 +2,106 @@ langcode: en status: true dependencies: module: - - user - - search_api - - node - - media_entity - - taxonomy + - node + - user + - media_entity + - taxonomy + - search_api config: - - field.storage.node.field_channel - - search_api.server.database + - field.storage.node.field_channel + - field.storage.node.field_tags + - search_api.server.database id: content name: Content description: '' read_only: false field_settings: + field_channel: + label: Channel + datasource_id: 'entity:node' + property_path: field_channel + type: integer + dependencies: + config: + - field.storage.node.field_channel + field_tags: + label: Tags + datasource_id: 'entity:node' + property_path: field_tags + type: integer + dependencies: + config: + - field.storage.node.field_tags + label: + label: Label + property_path: aggregated_field + type: text + boost: !!float 8 + configuration: + type: union + fields: + - 'entity:media/name' + - 'entity:node/title' + - 'entity:taxonomy_term/name' + media_author: + label: 'Publisher ID » User » Name' + datasource_id: 'entity:media' + property_path: 'uid:entity:name' + type: string + dependencies: + module: + - media_entity + - user + - user + media_changed: + label: Changed + datasource_id: 'entity:media' + property_path: changed + type: date + dependencies: + module: + - media_entity + media_status: + label: 'Publishing status' + datasource_id: 'entity:media' + property_path: status + type: boolean + dependencies: + module: + - media_entity + name: + label: 'Authored by » User » Name' + datasource_id: 'entity:node' + property_path: 'uid:entity:name' + type: string + dependencies: + module: + - node + - user + - user + node_changed: + label: Changed + datasource_id: 'entity:node' + property_path: changed + type: date + dependencies: + module: + - node + node_grants: + label: 'Node access information' + property_path: search_api_node_grants + type: string + indexed_locked: true + type_locked: true + hidden: true + promote: + label: 'Promoted to front page' + datasource_id: 'entity:node' + property_path: promote + type: boolean + dependencies: + module: + - node rendered_item: label: 'Rendered HTML output' property_path: rendered_item @@ -23,9 +110,6 @@ field_settings: roles: anonymous: anonymous view_mode: - 'entity:node': - article: default - page: default 'entity:media': gallery: default image: default @@ -33,37 +117,12 @@ field_settings: pinterest: default twitter: default video: default + 'entity:node': + article: default + page: default 'entity:taxonomy_term': channel: default tags: default - node_grants: - label: 'Node access information' - property_path: search_api_node_grants - type: string - indexed_locked: true - type_locked: true - hidden: true - label: - label: Label - property_path: aggregated_field - type: text - boost: !!float 8 - configuration: - type: union - fields: - - 'entity:node/title' - - 'entity:media/name' - - 'entity:taxonomy_term/name' - type: - label: Type - property_path: aggregated_field - type: string - configuration: - type: union - fields: - - 'entity:node/type' - - 'entity:media/bundle' - - 'entity:taxonomy_term/vid' status: label: status datasource_id: 'entity:node' @@ -71,81 +130,62 @@ field_settings: type: boolean indexed_locked: true type_locked: true - uid: - label: uid - datasource_id: 'entity:node' - property_path: uid - type: integer - indexed_locked: true - type_locked: true - name: - label: 'Authored by » User » Name' - datasource_id: 'entity:node' - property_path: 'uid:entity:name' - type: string dependencies: module: - - user + - node sticky: label: 'Sticky at top of lists' datasource_id: 'entity:node' property_path: sticky type: boolean - promote: - label: 'Promoted to front page' - datasource_id: 'entity:node' - property_path: promote - type: boolean - field_channel: - label: Channel - datasource_id: 'entity:node' - property_path: field_channel - type: integer - dependencies: - config: - - field.storage.node.field_channel - node_changed: - label: Changed - datasource_id: 'entity:node' - property_path: changed - type: date - media_changed: - label: Changed - datasource_id: 'entity:media' - property_path: changed - type: date - media_status: - label: 'Publishing status' - datasource_id: 'entity:media' - property_path: status - type: boolean - media_author: - label: 'Publisher ID » User » Name' - datasource_id: 'entity:media' - property_path: 'uid:entity:name' - type: string dependencies: module: - - user + - node term_changed: label: Changed datasource_id: 'entity:taxonomy_term' property_path: changed type: date + dependencies: + module: + - taxonomy term_status: label: Published datasource_id: 'entity:taxonomy_term' property_path: status type: boolean + dependencies: + module: + - taxonomy + type: + label: Type + property_path: aggregated_field + type: string + configuration: + type: union + fields: + - 'entity:media/bundle' + - 'entity:node/type' + - 'entity:taxonomy_term/vid' + uid: + label: uid + datasource_id: 'entity:node' + property_path: uid + type: integer + indexed_locked: true + type_locked: true + dependencies: + module: + - node datasource_settings: - 'entity:node': + 'entity:media': bundles: default: true selected: { } languages: default: true selected: { } - 'entity:media': + 'entity:node': bundles: default: true selected: { } @@ -165,33 +205,38 @@ processor_settings: content_access: weights: preprocess_query: -30 + hierarchy: + fields: + field_channel: taxonomy_term-parent + weights: + preprocess_index: -45 html_filter: all_fields: true fields: - - rendered_item - - label - - type - - name - - media_author + - label + - media_author + - name + - rendered_item + - type title: true alt: true tags: + b: 2 h1: 5 h2: 3 h3: 2 strong: 2 - b: 2 weights: preprocess_index: -15 preprocess_query: -15 ignorecase: all_fields: true fields: - - rendered_item - - label - - type - - name - - media_author + - label + - media_author + - name + - rendered_item + - type weights: preprocess_index: -20 preprocess_query: -20 @@ -199,52 +244,52 @@ processor_settings: stopwords: all_fields: true fields: - - rendered_item - - label + - label + - rendered_item stopwords: - - a - - an - - and - - are - - as - - at - - be - - but - - by - - for - - if - - in - - into - - is - - it - - 'no' - - not - - of - - 'on' - - or - - s - - such - - t - - that - - the - - their - - then - - there - - these - - they - - this - - to - - was - - will - - with + - a + - an + - and + - are + - as + - at + - be + - but + - by + - for + - if + - in + - into + - is + - it + - 'no' + - not + - of + - 'on' + - or + - s + - such + - t + - that + - the + - their + - then + - there + - these + - they + - this + - to + - was + - will + - with weights: preprocess_index: -5 preprocess_query: -2 tokenizer: all_fields: true fields: - - rendered_item - - label + - label + - rendered_item spaces: '' overlap_cjk: 1 minimum_word_size: '3' @@ -254,19 +299,14 @@ processor_settings: transliteration: all_fields: true fields: - - rendered_item - - label - - type - - name - - media_author + - label + - media_author + - name + - rendered_item + - type weights: preprocess_index: -20 preprocess_query: -20 - hierarchy: - fields: - field_channel: taxonomy_term-parent - weights: - preprocess_index: -45 tracker_settings: default: indexing_order: fifo diff --git a/modules/thunder_search/thunder_search.info.yml b/modules/thunder_search/thunder_search.info.yml index dda95a78c..25748b842 100644 --- a/modules/thunder_search/thunder_search.info.yml +++ b/modules/thunder_search/thunder_search.info.yml @@ -5,5 +5,6 @@ core: 8.x dependencies: - facets:facets - search_api:search_api_db + - select2:select2_facets - views_bulk_operations:views_bulk_operations package: Thunder From 3098241efde31925b221a8a8f674e8e3ade28e26 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 10 Oct 2018 13:53:08 +0200 Subject: [PATCH 070/134] Use select2 facet widget --- .../config/optional/facets.facet.author.yml | 12 ++-- .../config/optional/facets.facet.channel.yml | 17 +++-- .../optional/facets.facet.media_status.yml | 14 ++-- .../optional/facets.facet.media_type.yml | 12 ++-- .../facets.facet.promoted_to_front_page.yml | 12 ++-- .../facets.facet.publishing_status.yml | 67 ------------------- .../config/optional/facets.facet.status.yml | 10 +-- .../facets.facet.sticky_at_top_of_lists.yml | 12 ++-- .../config/optional/facets.facet.tags.yml | 14 ++-- .../config/optional/facets.facet.type.yml | 12 ++-- .../src/Plugin/views/area/FacetBlock.php | 27 +++++--- scripts/travis/04-install-thunder.sh | 4 +- 12 files changed, 90 insertions(+), 123 deletions(-) delete mode 100644 modules/thunder_search/config/optional/facets.facet.publishing_status.yml diff --git a/modules/thunder_search/config/optional/facets.facet.author.yml b/modules/thunder_search/config/optional/facets.facet.author.yml index 6beccc633..0ee6e49b8 100644 --- a/modules/thunder_search/config/optional/facets.facet.author.yml +++ b/modules/thunder_search/config/optional/facets.facet.author.yml @@ -2,14 +2,14 @@ langcode: en status: true dependencies: config: - - search_api.index.content - - views.view.content_search_api + - search_api.index.content + - views.view.content_search_api module: - - search_api + - search_api id: author name: Author url_alias: author -weight: 0 +weight: -2 min_count: 1 show_only_one_result: true field_identifier: uid @@ -17,7 +17,9 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: - show_numbers: false + width: 100% + autocomplete: 0 + match_operator: CONTAINS query_operator: or use_hierarchy: false expand_hierarchy: false diff --git a/modules/thunder_search/config/optional/facets.facet.channel.yml b/modules/thunder_search/config/optional/facets.facet.channel.yml index f2354d674..fdb0d8c81 100644 --- a/modules/thunder_search/config/optional/facets.facet.channel.yml +++ b/modules/thunder_search/config/optional/facets.facet.channel.yml @@ -2,14 +2,14 @@ langcode: en status: true dependencies: config: - - search_api.index.content - - views.view.content_search_api + - search_api.index.content + - views.view.content_search_api module: - - search_api + - search_api id: channel name: Channel url_alias: channel -weight: 0 +weight: -4 min_count: 0 show_only_one_result: true field_identifier: field_channel @@ -17,7 +17,9 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: - show_numbers: false + width: 100% + autocomplete: 0 + match_operator: CONTAINS query_operator: or use_hierarchy: true expand_hierarchy: true @@ -49,6 +51,11 @@ processor_configs: weights: build: -10 settings: { } + hide_non_narrowing_result_processor: + processor_id: hide_non_narrowing_result_processor + weights: + build: 40 + settings: { } translate_entity: processor_id: translate_entity weights: diff --git a/modules/thunder_search/config/optional/facets.facet.media_status.yml b/modules/thunder_search/config/optional/facets.facet.media_status.yml index 8f7126b2c..674792648 100644 --- a/modules/thunder_search/config/optional/facets.facet.media_status.yml +++ b/modules/thunder_search/config/optional/facets.facet.media_status.yml @@ -2,14 +2,14 @@ langcode: en status: true dependencies: config: - - search_api.index.content - - views.view.media_search_api + - search_api.index.content + - views.view.media_search_api module: - - search_api + - search_api id: media_status -name: 'Publishing status' +name: Status url_alias: media_status -weight: 0 +weight: -1 min_count: 1 show_only_one_result: true field_identifier: media_status @@ -17,7 +17,9 @@ facet_source_id: 'search_api:views_page__media_search_api__page_1' widget: type: select2 config: - show_numbers: false + width: 100% + autocomplete: 0 + match_operator: CONTAINS query_operator: or use_hierarchy: false expand_hierarchy: false diff --git a/modules/thunder_search/config/optional/facets.facet.media_type.yml b/modules/thunder_search/config/optional/facets.facet.media_type.yml index 74f95066d..573a4ec73 100644 --- a/modules/thunder_search/config/optional/facets.facet.media_type.yml +++ b/modules/thunder_search/config/optional/facets.facet.media_type.yml @@ -2,14 +2,14 @@ langcode: en status: true dependencies: config: - - search_api.index.content - - views.view.media_search_api + - search_api.index.content + - views.view.media_search_api module: - - search_api + - search_api id: media_type name: Type url_alias: media_type -weight: 0 +weight: -2 min_count: 1 show_only_one_result: true field_identifier: type @@ -17,7 +17,9 @@ facet_source_id: 'search_api:views_page__media_search_api__page_1' widget: type: select2 config: - show_numbers: false + width: 100% + autocomplete: 0 + match_operator: CONTAINS query_operator: or use_hierarchy: false expand_hierarchy: false diff --git a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml index 4e54baffc..108b227d3 100644 --- a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml +++ b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml @@ -2,14 +2,14 @@ langcode: en status: true dependencies: config: - - search_api.index.content - - views.view.content_search_api + - search_api.index.content + - views.view.content_search_api module: - - search_api + - search_api id: promoted_to_front_page name: Promoted url_alias: promoted_to_front_page -weight: 0 +weight: 1 min_count: 1 show_only_one_result: true field_identifier: promote @@ -17,7 +17,9 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: - show_numbers: false + width: 100% + autocomplete: 0 + match_operator: CONTAINS query_operator: or use_hierarchy: false expand_hierarchy: false diff --git a/modules/thunder_search/config/optional/facets.facet.publishing_status.yml b/modules/thunder_search/config/optional/facets.facet.publishing_status.yml deleted file mode 100644 index 68d5ba0ed..000000000 --- a/modules/thunder_search/config/optional/facets.facet.publishing_status.yml +++ /dev/null @@ -1,67 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - search_api.index.content - - views.view.media_search_api - module: - - search_api -id: publishing_status -name: Status -url_alias: publishing_status -weight: 0 -min_count: 1 -show_only_one_result: true -field_identifier: media_status -facet_source_id: 'search_api:views_page__media_search_api__page_1' -widget: - type: select2 - config: - show_numbers: false -query_operator: or -use_hierarchy: false -expand_hierarchy: false -enable_parent_when_child_gets_disabled: true -hard_limit: 0 -exclude: false -only_visible_when_facet_source_is_visible: true -processor_configs: - active_widget_order: - processor_id: active_widget_order - weights: - sort: -10 - settings: - sort: DESC - boolean_item: - processor_id: boolean_item - weights: - build: -10 - settings: - on_value: Published - off_value: Unpublished - count_widget_order: - processor_id: count_widget_order - weights: - sort: -10 - settings: - sort: DESC - display_value_widget_order: - processor_id: display_value_widget_order - weights: - sort: -10 - settings: - sort: ASC - hide_non_narrowing_result_processor: - processor_id: hide_non_narrowing_result_processor - weights: - build: -10 - settings: { } - url_processor_handler: - processor_id: url_processor_handler - weights: - pre_query: -10 - build: -10 - settings: { } -empty_behavior: - behavior: none -show_title: false diff --git a/modules/thunder_search/config/optional/facets.facet.status.yml b/modules/thunder_search/config/optional/facets.facet.status.yml index 1498d87c0..e37499ef8 100644 --- a/modules/thunder_search/config/optional/facets.facet.status.yml +++ b/modules/thunder_search/config/optional/facets.facet.status.yml @@ -2,10 +2,10 @@ langcode: en status: true dependencies: config: - - search_api.index.content - - views.view.content_search_api + - search_api.index.content + - views.view.content_search_api module: - - search_api + - search_api id: status name: Status url_alias: status @@ -17,7 +17,9 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: - show_numbers: false + width: 100% + autocomplete: 0 + match_operator: CONTAINS query_operator: or use_hierarchy: false expand_hierarchy: false diff --git a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml index d9a936ad4..c4fae9fe4 100644 --- a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml +++ b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml @@ -2,14 +2,14 @@ langcode: en status: true dependencies: config: - - search_api.index.content - - views.view.content_search_api + - search_api.index.content + - views.view.content_search_api module: - - search_api + - search_api id: sticky_at_top_of_lists name: Sticky url_alias: sticky_at_top_of_lists -weight: 0 +weight: 2 min_count: 1 show_only_one_result: true field_identifier: sticky @@ -17,7 +17,9 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: - show_numbers: false + width: 100% + autocomplete: 0 + match_operator: CONTAINS query_operator: or use_hierarchy: false expand_hierarchy: false diff --git a/modules/thunder_search/config/optional/facets.facet.tags.yml b/modules/thunder_search/config/optional/facets.facet.tags.yml index 30167c84c..d71966295 100644 --- a/modules/thunder_search/config/optional/facets.facet.tags.yml +++ b/modules/thunder_search/config/optional/facets.facet.tags.yml @@ -2,14 +2,14 @@ langcode: en status: true dependencies: config: - - search_api.index.content - - views.view.content_search_api + - search_api.index.content + - views.view.content_search_api module: - - search_api + - search_api id: tags name: Tags url_alias: tags -weight: 0 +weight: -3 min_count: 1 show_only_one_result: false field_identifier: field_tags @@ -17,8 +17,10 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: - show_numbers: false -query_operator: or + width: 300px + autocomplete: 1 + match_operator: CONTAINS +query_operator: and use_hierarchy: true expand_hierarchy: true enable_parent_when_child_gets_disabled: true diff --git a/modules/thunder_search/config/optional/facets.facet.type.yml b/modules/thunder_search/config/optional/facets.facet.type.yml index 3b1587c71..6151f7b07 100644 --- a/modules/thunder_search/config/optional/facets.facet.type.yml +++ b/modules/thunder_search/config/optional/facets.facet.type.yml @@ -2,14 +2,14 @@ langcode: en status: true dependencies: config: - - search_api.index.content - - views.view.content_search_api + - search_api.index.content + - views.view.content_search_api module: - - search_api + - search_api id: type name: Type url_alias: type -weight: 0 +weight: -1 min_count: 1 show_only_one_result: true field_identifier: type @@ -17,7 +17,9 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: - show_numbers: false + width: 100% + autocomplete: 0 + match_operator: CONTAINS query_operator: or use_hierarchy: false expand_hierarchy: false diff --git a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php index 68cfc4399..b9c13e954 100644 --- a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php +++ b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php @@ -18,27 +18,37 @@ class FacetBlock extends AreaPluginBase { */ public function render($empty = FALSE) { - /** @var \Drupal\facets\Entity\Facet[] $facets */ - $facets = \Drupal::entityTypeManager() - ->getStorage('facets_facet') - ->loadMultiple(); - /** @var \Drupal\facets\FacetManager\DefaultFacetManager $facetManager */ $facetManager = \Drupal::service('facets.manager'); + + /** @var \Drupal\facets\FacetSource\FacetSourcePluginManager $source */ + $sources = \Drupal::service('plugin.manager.facets.facet_source'); + + $facet_source = NULL; + foreach ($sources->getDefinitions() as $definition) { + /** @var \Drupal\facets\Plugin\facets\facet_source\SearchApiDisplay $source */ + $source = $sources->createInstance($definition['id']); + if ($this->view->id() == $source->getViewsDisplay()->id() && $this->view->current_display == $source->getViewsDisplay()->current_display) { + $facet_source = $source; + } + } + if (!$facet_source) { + return []; + } + $build = ['#type' => 'container', '#attributes' => ['class' => 'form--inline clearfix']]; $build['_view'] = $this->view->display_handler->viewExposedFormBlocks(); - foreach ($facets as $id => $facet) { + foreach ($facetManager->getFacetsByFacetSourceId($facet_source->pluginId) as $id => $facet) { // No need to build the facet if it does not need to be visible. if (($facet->getOnlyVisibleWhenFacetSourceIsVisible() && !$facet->getFacetSource()->isRenderedInCurrentRequest())) { continue; } - $config = $facet->getFacetSource()->getDisplay()->getPluginDefinition(); if ($config['view_id'] == $this->view->id() && $config['view_display'] == $this->view->current_display) { $built_facet = $facetManager->build($facet); if (!in_array('facet-empty', $built_facet[0]['#attributes']['class'])) { - $build[$id] = [ + $build['facets'][$id] = [ '#type' => 'container', '#attributes' => ['class' => 'form-item'], 'label' => [ @@ -47,6 +57,7 @@ public function render($empty = FALSE) { '#title_display' => 'above', ], 'element' => $built_facet, + '#weight' => $facet->getWeight(), ]; } } diff --git a/scripts/travis/04-install-thunder.sh b/scripts/travis/04-install-thunder.sh index 653126c8d..dc0d09ab0 100755 --- a/scripts/travis/04-install-thunder.sh +++ b/scripts/travis/04-install-thunder.sh @@ -66,8 +66,8 @@ apply_patches() { # apply cookie expire patch for javascript tests #wget https://www.drupal.org/files/issues/test-session-expire-2771547-64.patch #patch -p1 < test-session-expire-2771547-64.patch - wget https://www.drupal.org/files/issues/character_set_wrongly-2921548-2.patch - patch -p1 < character_set_wrongly-2921548-2.patch + #wget https://www.drupal.org/files/issues/character_set_wrongly-2921548-2.patch + #patch -p1 < character_set_wrongly-2921548-2.patch } create_testing_dump() { From 467cef35a9849d9bccb843af7010539474eaefae Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 17 Oct 2018 10:12:30 +0200 Subject: [PATCH 071/134] Add views bulk patch --- composer.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0eb957d09..c8a58015f 100644 --- a/composer.json +++ b/composer.json @@ -76,6 +76,9 @@ }, "drupal/scheduler": { "Scheduler integration with core Content moderation": "https://www.drupal.org/files/issues/2018-08-02/2798689-102.patch" + }, + "drupal/views_bulk_operations": { + "Fatal error when executing simple actions on Adminimal theme": "https://www.drupal.org/files/issues/2018-09-19/views_bulk_operations-theme_error-2952498-29.patch" } } }, @@ -143,7 +146,7 @@ "drupal/thunder_admin": "^1.0 || ^2.0-beta15", "drupal/token": "^1.0", "drupal/video_embed_field": "^1.0", - "drupal/views_bulk_operations": "^2.0", + "drupal/views_bulk_operations": "2.4", "drupal/views_load_more": "dev-1.x", "valiton/harbourmaster": "~8.1", "bower-asset/dropzone": "^5.1", From 0c46aa7ba22af130cb5ad11086c17cacfab5d9df Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 18 Oct 2018 14:13:20 +0200 Subject: [PATCH 072/134] Update facets --- .../config/optional/facets.facet.author.yml | 3 ++- .../config/optional/facets.facet.channel.yml | 3 ++- .../optional/facets.facet.media_status.yml | 3 ++- .../optional/facets.facet.media_type.yml | 3 ++- .../facets.facet.promoted_to_front_page.yml | 3 ++- .../config/optional/facets.facet.status.yml | 3 ++- .../facets.facet.sticky_at_top_of_lists.yml | 3 ++- .../config/optional/facets.facet.tags.yml | 3 ++- .../config/optional/facets.facet.type.yml | 3 ++- .../Functional/InstalledConfigurationTest.php | 26 +------------------ 10 files changed, 19 insertions(+), 34 deletions(-) diff --git a/modules/thunder_search/config/optional/facets.facet.author.yml b/modules/thunder_search/config/optional/facets.facet.author.yml index 0ee6e49b8..0c7f87123 100644 --- a/modules/thunder_search/config/optional/facets.facet.author.yml +++ b/modules/thunder_search/config/optional/facets.facet.author.yml @@ -17,8 +17,9 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: + show_numbers: false width: 100% - autocomplete: 0 + autocomplete: false match_operator: CONTAINS query_operator: or use_hierarchy: false diff --git a/modules/thunder_search/config/optional/facets.facet.channel.yml b/modules/thunder_search/config/optional/facets.facet.channel.yml index fdb0d8c81..5b9bcecae 100644 --- a/modules/thunder_search/config/optional/facets.facet.channel.yml +++ b/modules/thunder_search/config/optional/facets.facet.channel.yml @@ -17,8 +17,9 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: + show_numbers: false width: 100% - autocomplete: 0 + autocomplete: false match_operator: CONTAINS query_operator: or use_hierarchy: true diff --git a/modules/thunder_search/config/optional/facets.facet.media_status.yml b/modules/thunder_search/config/optional/facets.facet.media_status.yml index 674792648..856bed648 100644 --- a/modules/thunder_search/config/optional/facets.facet.media_status.yml +++ b/modules/thunder_search/config/optional/facets.facet.media_status.yml @@ -17,8 +17,9 @@ facet_source_id: 'search_api:views_page__media_search_api__page_1' widget: type: select2 config: + show_numbers: false width: 100% - autocomplete: 0 + autocomplete: false match_operator: CONTAINS query_operator: or use_hierarchy: false diff --git a/modules/thunder_search/config/optional/facets.facet.media_type.yml b/modules/thunder_search/config/optional/facets.facet.media_type.yml index 573a4ec73..1fdbc0560 100644 --- a/modules/thunder_search/config/optional/facets.facet.media_type.yml +++ b/modules/thunder_search/config/optional/facets.facet.media_type.yml @@ -17,8 +17,9 @@ facet_source_id: 'search_api:views_page__media_search_api__page_1' widget: type: select2 config: + show_numbers: false width: 100% - autocomplete: 0 + autocomplete: false match_operator: CONTAINS query_operator: or use_hierarchy: false diff --git a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml index 108b227d3..5203adc7f 100644 --- a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml +++ b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml @@ -17,8 +17,9 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: + show_numbers: false width: 100% - autocomplete: 0 + autocomplete: false match_operator: CONTAINS query_operator: or use_hierarchy: false diff --git a/modules/thunder_search/config/optional/facets.facet.status.yml b/modules/thunder_search/config/optional/facets.facet.status.yml index e37499ef8..063fdbc2e 100644 --- a/modules/thunder_search/config/optional/facets.facet.status.yml +++ b/modules/thunder_search/config/optional/facets.facet.status.yml @@ -17,8 +17,9 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: + show_numbers: false width: 100% - autocomplete: 0 + autocomplete: false match_operator: CONTAINS query_operator: or use_hierarchy: false diff --git a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml index c4fae9fe4..aa63c7a40 100644 --- a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml +++ b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml @@ -17,8 +17,9 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: + show_numbers: false width: 100% - autocomplete: 0 + autocomplete: false match_operator: CONTAINS query_operator: or use_hierarchy: false diff --git a/modules/thunder_search/config/optional/facets.facet.tags.yml b/modules/thunder_search/config/optional/facets.facet.tags.yml index d71966295..7229a20da 100644 --- a/modules/thunder_search/config/optional/facets.facet.tags.yml +++ b/modules/thunder_search/config/optional/facets.facet.tags.yml @@ -17,8 +17,9 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: + show_numbers: false width: 300px - autocomplete: 1 + autocomplete: true match_operator: CONTAINS query_operator: and use_hierarchy: true diff --git a/modules/thunder_search/config/optional/facets.facet.type.yml b/modules/thunder_search/config/optional/facets.facet.type.yml index 6151f7b07..d028b46e9 100644 --- a/modules/thunder_search/config/optional/facets.facet.type.yml +++ b/modules/thunder_search/config/optional/facets.facet.type.yml @@ -17,8 +17,9 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: + show_numbers: false width: 100% - autocomplete: 0 + autocomplete: false match_operator: CONTAINS query_operator: or use_hierarchy: false diff --git a/tests/src/Functional/InstalledConfigurationTest.php b/tests/src/Functional/InstalledConfigurationTest.php index 265b2e329..4c933a8e1 100644 --- a/tests/src/Functional/InstalledConfigurationTest.php +++ b/tests/src/Functional/InstalledConfigurationTest.php @@ -36,7 +36,7 @@ class InstalledConfigurationTest extends ThunderTestBase { 'thunder_riddle', 'harbourmaster', 'simple_gmap', - 'thunder_search', + #'thunder_search', // Additional modules. // 'thunder_fia', @@ -144,25 +144,6 @@ class InstalledConfigurationTest extends ThunderTestBase { 'interface' => ['default' => TRUE], ], - // User register is changed by Thunder Install hook. - 'user.settings' => [ - 'register' => TRUE, - ], - - // View status is changed by Thunder Install hook. - 'views.view.media' => [ - 'dependencies' => [ - 'config' => TRUE, - ], - 'status' => TRUE, - ], - 'views.view.thunder_media' => [ - 'status' => TRUE, - ], - 'views.view.content' => [ - 'status' => TRUE, - ], - // Changed on installation. 'views.view.glossary' => [ 'dependencies' => [ @@ -238,11 +219,6 @@ class InstalledConfigurationTest extends ThunderTestBase { 'moderation_state' => TRUE, ], ], - 'core.entity_form_display.paragraph.nexx_video.default' => [ - 'content' => [ - 'moderation_state' => TRUE, - ], - ], 'paragraphs.paragraphs_type.nexx_video' => [ 'icon_uuid' => TRUE, 'description' => TRUE, From bf9e4ed260d9f26f1d038f0dd8dbaca13d66f78b Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 18 Oct 2018 14:16:02 +0200 Subject: [PATCH 073/134] Fix CS --- tests/src/Functional/InstalledConfigurationTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/src/Functional/InstalledConfigurationTest.php b/tests/src/Functional/InstalledConfigurationTest.php index 4c933a8e1..3396e90b8 100644 --- a/tests/src/Functional/InstalledConfigurationTest.php +++ b/tests/src/Functional/InstalledConfigurationTest.php @@ -36,7 +36,6 @@ class InstalledConfigurationTest extends ThunderTestBase { 'thunder_riddle', 'harbourmaster', 'simple_gmap', - #'thunder_search', // Additional modules. // 'thunder_fia', From cea413cca0920ab9d3adfa3e93c68abf87dde535 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 18 Oct 2018 14:33:31 +0200 Subject: [PATCH 074/134] Add dev branch of select2 --- composer.json | 2 +- tests/src/Functional/InstalledConfigurationTest.php | 1 + thunder.post_update.php | 8 ++++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 50adf312d..9d0caf82d 100644 --- a/composer.json +++ b/composer.json @@ -138,7 +138,7 @@ "drupal/riddle_marketplace": "^2.0", "drupal/scheduler": "1.0", "drupal/search_api": "1.10", - "drupal/select2": "^1.0", + "drupal/select2": "dev-1.x", "drupal/simple_sitemap": "^2.0", "drupal/shariff": "^1.0", "drupal/slick": "^1.0", diff --git a/tests/src/Functional/InstalledConfigurationTest.php b/tests/src/Functional/InstalledConfigurationTest.php index 3396e90b8..807f4eb83 100644 --- a/tests/src/Functional/InstalledConfigurationTest.php +++ b/tests/src/Functional/InstalledConfigurationTest.php @@ -36,6 +36,7 @@ class InstalledConfigurationTest extends ThunderTestBase { 'thunder_riddle', 'harbourmaster', 'simple_gmap', + 'thunder_search', // Additional modules. // 'thunder_fia', diff --git a/thunder.post_update.php b/thunder.post_update.php index ee8732508..54f538857 100644 --- a/thunder.post_update.php +++ b/thunder.post_update.php @@ -16,8 +16,12 @@ function thunder_post_update_add_config_selector_to_content_media() { // Execute configuration update definitions with logging of success. if ($thunderUpdater->executeUpdates([['thunder', 'thunder_add_config_selector_to_content_media']])) { - View::load('content')->save(); - View::load('thunder_media')->save(); + if ($view = View::load('content')) { + $view->save(); + } + if ($view = View::load('thunder_media')) { + $view->save(); + } /** @var \Drupal\config_update\ConfigReverter $configReverter */ $configReverter = \Drupal::service('config_update.config_update'); $configReverter->import('config_selector_feature', 'thunder_content_view'); From eef4ee252df0d703951852222f15f55a3e4a3ec5 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Fri, 19 Oct 2018 12:31:41 +0200 Subject: [PATCH 075/134] Cleanup --- composer.json | 2 +- scripts/travis/04-install-thunder.sh | 6 ++---- tests/src/Functional/Integration/ConfigSelectorTest.php | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 9d0caf82d..50adf312d 100644 --- a/composer.json +++ b/composer.json @@ -138,7 +138,7 @@ "drupal/riddle_marketplace": "^2.0", "drupal/scheduler": "1.0", "drupal/search_api": "1.10", - "drupal/select2": "dev-1.x", + "drupal/select2": "^1.0", "drupal/simple_sitemap": "^2.0", "drupal/shariff": "^1.0", "drupal/slick": "^1.0", diff --git a/scripts/travis/04-install-thunder.sh b/scripts/travis/04-install-thunder.sh index 25f3a5a01..a9b0e410b 100755 --- a/scripts/travis/04-install-thunder.sh +++ b/scripts/travis/04-install-thunder.sh @@ -63,8 +63,6 @@ apply_patches() { # apply cookie expire patch for javascript tests #wget https://www.drupal.org/files/issues/test-session-expire-2771547-64.patch #patch -p1 < test-session-expire-2771547-64.patch - #wget https://www.drupal.org/files/issues/character_set_wrongly-2921548-2.patch - #patch -p1 < character_set_wrongly-2921548-2.patch } create_testing_dump() { @@ -88,6 +86,6 @@ else install_thunder ${TEST_DIR}/docroot fi -apply_patches - create_testing_dump + +apply_patches diff --git a/tests/src/Functional/Integration/ConfigSelectorTest.php b/tests/src/Functional/Integration/ConfigSelectorTest.php index 6830db4b3..852c54663 100644 --- a/tests/src/Functional/Integration/ConfigSelectorTest.php +++ b/tests/src/Functional/Integration/ConfigSelectorTest.php @@ -2,14 +2,14 @@ namespace Drupal\Tests\thunder\Functional\Integration; -use Drupal\thunder\ThunderBaseTest; +use Drupal\Tests\thunder\Functional\ThunderTestBase; /** * Tests integration with the config_selector. * * @group Thunder */ -class ConfigSelectorTest extends ThunderBaseTest { +class ConfigSelectorTest extends ThunderTestBase { protected static $modules = ['thunder_demo']; From fc0beca72caa325ace884d3a8fc18bb3361ab70e Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Mon, 22 Oct 2018 13:54:26 +0200 Subject: [PATCH 076/134] Show message --- modules/thunder_search/thunder_search.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/thunder_search/thunder_search.install b/modules/thunder_search/thunder_search.install index 6a1a91cef..9d6396d30 100644 --- a/modules/thunder_search/thunder_search.install +++ b/modules/thunder_search/thunder_search.install @@ -9,5 +9,5 @@ * Implements hook_install(). */ function thunder_search_install() { - search_api_cron(); + \Drupal::messenger()->addStatus(t("It's needed to index the search index in order to have all content searchable.")); } From 49c91224a66d8d774ad6841ef7cebf03fe7566fa Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 23 Oct 2018 14:42:38 +0200 Subject: [PATCH 077/134] WIP --- .../src/Functional/Integration/ConfigSelectorTest.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/src/Functional/Integration/ConfigSelectorTest.php b/tests/src/Functional/Integration/ConfigSelectorTest.php index 852c54663..6491e7eb8 100644 --- a/tests/src/Functional/Integration/ConfigSelectorTest.php +++ b/tests/src/Functional/Integration/ConfigSelectorTest.php @@ -3,13 +3,14 @@ namespace Drupal\Tests\thunder\Functional\Integration; use Drupal\Tests\thunder\Functional\ThunderTestBase; +use Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase; /** * Tests integration with the config_selector. * * @group Thunder */ -class ConfigSelectorTest extends ThunderTestBase { +class ConfigSelectorTest extends ThunderJavascriptTestBase { protected static $modules = ['thunder_demo']; @@ -29,10 +30,16 @@ public function testContentViewSearchApi() { // Install thunder_search. $this->drupalPostForm('admin/modules', ['modules[thunder_search][enable]' => 1], 'Install'); + $this->drupalGet('admin/config/search/search-api/index/content'); $this->click('#edit-submit'); // Now we have a search_api based view. - $this->drupalGet('admin/content'); + $this->drupalGet('admin/config/search/search-api/index/content'); + $this->getSession()->getPage()->pressButton('Track now'); + + + $this->drupalGet('admin/config/search/search-api/index/content'); + #$this->drupalGet('admin/content'); $assert_session->elementExists('xpath', '//*[@id="view-label-table-column"]/a'); $assert_session->elementExists('css', '#block-thunder-admin-content > div > div.view-content-search-api'); From 9b9daf7635f5794545540467b2f62e1c674b75fe Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 25 Oct 2018 11:16:33 +0200 Subject: [PATCH 078/134] Fix test --- .../Integration/ConfigSelectorTest.php | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) rename tests/src/{Functional => FunctionalJavascript}/Integration/ConfigSelectorTest.php (66%) diff --git a/tests/src/Functional/Integration/ConfigSelectorTest.php b/tests/src/FunctionalJavascript/Integration/ConfigSelectorTest.php similarity index 66% rename from tests/src/Functional/Integration/ConfigSelectorTest.php rename to tests/src/FunctionalJavascript/Integration/ConfigSelectorTest.php index 6491e7eb8..df5d91ed2 100644 --- a/tests/src/Functional/Integration/ConfigSelectorTest.php +++ b/tests/src/FunctionalJavascript/Integration/ConfigSelectorTest.php @@ -1,8 +1,7 @@ logWithRole('administrator'); - $assert_session = $this->assertSession(); // Content lock fields are there by default. @@ -29,23 +28,20 @@ public function testContentViewSearchApi() { $assert_session->elementExists('css', '#block-thunder-admin-content > div > div.view-content'); // Install thunder_search. - $this->drupalPostForm('admin/modules', ['modules[thunder_search][enable]' => 1], 'Install'); - $this->drupalGet('admin/config/search/search-api/index/content'); - $this->click('#edit-submit'); + \Drupal::service('module_installer')->install(['thunder_search']); // Now we have a search_api based view. $this->drupalGet('admin/config/search/search-api/index/content'); - $this->getSession()->getPage()->pressButton('Track now'); + $this->getSession()->getPage()->pressButton('Index now'); + $assert_session->waitForId('edit-index-now'); - - $this->drupalGet('admin/config/search/search-api/index/content'); - #$this->drupalGet('admin/content'); + $this->drupalGet('admin/content'); $assert_session->elementExists('xpath', '//*[@id="view-label-table-column"]/a'); $assert_session->elementExists('css', '#block-thunder-admin-content > div > div.view-content-search-api'); // Uninstall search_api. - $this->drupalPostForm('admin/modules/uninstall', ['uninstall[thunder_search]' => 1, 'uninstall[search_api]' => 1], 'Uninstall'); - $this->click('#edit-submit'); + \Drupal::service('module_installer')->uninstall(['thunder_search', 'search_api']); + drupal_flush_all_caches(); // The normal view is back. $this->drupalGet('admin/content'); From 6038bd355913dd37e78838cd89aafadf05d6fd3d Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 25 Oct 2018 13:27:08 +0200 Subject: [PATCH 079/134] Fix InstalledConfigurationTest --- tests/src/Functional/InstalledConfigurationTest.php | 6 ++++++ tests/src/Functional/ModuleUninstallTest.php | 1 + 2 files changed, 7 insertions(+) diff --git a/tests/src/Functional/InstalledConfigurationTest.php b/tests/src/Functional/InstalledConfigurationTest.php index 807f4eb83..66b8f281f 100644 --- a/tests/src/Functional/InstalledConfigurationTest.php +++ b/tests/src/Functional/InstalledConfigurationTest.php @@ -145,6 +145,12 @@ class InstalledConfigurationTest extends ThunderTestBase { ], // Changed on installation. + 'views.view.content' => [ + 'status' => TRUE, + ], + 'views.view.thunder_media' => [ + 'status' => TRUE, + ], 'views.view.glossary' => [ 'dependencies' => [ 'config' => TRUE, diff --git a/tests/src/Functional/ModuleUninstallTest.php b/tests/src/Functional/ModuleUninstallTest.php index fb19d9f78..a5e24ad22 100644 --- a/tests/src/Functional/ModuleUninstallTest.php +++ b/tests/src/Functional/ModuleUninstallTest.php @@ -35,6 +35,7 @@ class ModuleUninstallTest extends ThunderTestBase { ['length_indicator'], ['redirect'], ['simple_sitemap'], + ['thunder_search', 'search_api_db', 'search_api', 'facets'], // ['amp'], // Patch provided: https://www.drupal.org/files/issues/2901581_3.patch. From 08266a21382fcf4f2ed9aef82f0bb766dcb47c45 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 25 Oct 2018 16:29:21 +0200 Subject: [PATCH 080/134] Add empty behavior text --- .../views.view.content_search_api.yml | 63 ++++++++++------- .../optional/views.view.media_search_api.yml | 67 +++++++++++-------- .../src/Plugin/views/area/FacetBlock.php | 2 +- 3 files changed, 79 insertions(+), 53 deletions(-) diff --git a/modules/thunder_search/config/optional/views.view.content_search_api.yml b/modules/thunder_search/config/optional/views.view.content_search_api.yml index e9a26fb11..c6319e41b 100644 --- a/modules/thunder_search/config/optional/views.view.content_search_api.yml +++ b/modules/thunder_search/config/optional/views.view.content_search_api.yml @@ -2,17 +2,17 @@ langcode: en status: true dependencies: config: - - field.storage.node.field_channel - - field.storage.node.field_teaser_media - - image.style.thumbnail - - search_api.index.content + - field.storage.node.field_channel + - field.storage.node.field_teaser_media + - image.style.thumbnail + - search_api.index.content module: - - config_selector - - media_entity - - search_api - - thunder_search - - user - - views_bulk_operations + - config_selector + - media_entity + - search_api + - thunder_search + - user + - views_bulk_operations third_party_settings: config_selector: feature: thunder_content_view @@ -866,7 +866,20 @@ display: empty: false plugin_id: facet_block footer: { } - empty: { } + empty: + area: + id: area + table: views + field: area + relationship: none + group_type: group + admin_label: '' + empty: true + tokenize: false + content: + value: 'It''s needed to index the search index in order to have all content searchable.' + format: basic_html + plugin_id: text relationships: { } arguments: { } display_extenders: { } @@ -878,14 +891,14 @@ display: cache_metadata: max-age: 0 contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - user.permissions tags: - - 'config:field.storage.node.field_channel' - - 'config:field.storage.node.field_teaser_media' + - 'config:field.storage.node.field_channel' + - 'config:field.storage.node.field_teaser_media' page_1: display_options: path: admin/content @@ -916,11 +929,11 @@ display: cache_metadata: max-age: 0 contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - user.permissions tags: - - 'config:field.storage.node.field_channel' - - 'config:field.storage.node.field_teaser_media' + - 'config:field.storage.node.field_channel' + - 'config:field.storage.node.field_teaser_media' diff --git a/modules/thunder_search/config/optional/views.view.media_search_api.yml b/modules/thunder_search/config/optional/views.view.media_search_api.yml index f59e40e3f..219f7d325 100644 --- a/modules/thunder_search/config/optional/views.view.media_search_api.yml +++ b/modules/thunder_search/config/optional/views.view.media_search_api.yml @@ -2,17 +2,21 @@ langcode: en status: true dependencies: config: - - field.storage.media.field_expires - - image.style.thumbnail - - search_api.index.content + - field.storage.media.field_expires + - image.style.thumbnail + - search_api.index.content module: - - datetime - - image - - search_api - - thunder_search - - user - - views_bulk_operations - - config_selector + - config_selector + - datetime + - image + - search_api + - thunder_search + - user + - views_bulk_operations +third_party_settings: + config_selector: + feature: thunder_media_view + priority: 1 id: media_search_api label: 'Media - Search API' module: views @@ -21,10 +25,6 @@ tag: '' base_table: search_api_index_content base_field: search_api_id core: 8.x -third_party_settings: - config_selector: - feature: thunder_media_view - priority: 1 display: default: display_plugin: default @@ -829,7 +829,20 @@ display: empty: false plugin_id: facet_block footer: { } - empty: { } + empty: + area: + id: area + table: views + field: area + relationship: none + group_type: group + admin_label: '' + empty: true + tokenize: false + content: + value: 'It''s needed to index the search index in order to have all media items searchable.' + format: basic_html + plugin_id: text relationships: { } arguments: { } display_extenders: { } @@ -841,13 +854,13 @@ display: cache_metadata: max-age: 0 contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - user.permissions tags: - - 'config:field.storage.media.field_expires' + - 'config:field.storage.media.field_expires' page_1: display_options: path: admin/content/media @@ -878,10 +891,10 @@ display: cache_metadata: max-age: 0 contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - user.permissions tags: - - 'config:field.storage.media.field_expires' + - 'config:field.storage.media.field_expires' diff --git a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php index b9c13e954..a70c9f8b9 100644 --- a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php +++ b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php @@ -32,7 +32,7 @@ public function render($empty = FALSE) { $facet_source = $source; } } - if (!$facet_source) { + if (!$facet_source || !$this->view->result) { return []; } From 442482303ff92d3f02d2f88acf00ac7a3128949f Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 25 Oct 2018 16:33:16 +0200 Subject: [PATCH 081/134] Hide status facet without narrowing results --- .../config/optional/facets.facet.media_status.yml | 5 +++++ .../thunder_search/config/optional/facets.facet.status.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/modules/thunder_search/config/optional/facets.facet.media_status.yml b/modules/thunder_search/config/optional/facets.facet.media_status.yml index 856bed648..10fc291b5 100644 --- a/modules/thunder_search/config/optional/facets.facet.media_status.yml +++ b/modules/thunder_search/config/optional/facets.facet.media_status.yml @@ -54,6 +54,11 @@ processor_configs: sort: -10 settings: sort: ASC + hide_1_result_facet: + processor_id: hide_1_result_facet + weights: + build: 50 + settings: { } hide_non_narrowing_result_processor: processor_id: hide_non_narrowing_result_processor weights: diff --git a/modules/thunder_search/config/optional/facets.facet.status.yml b/modules/thunder_search/config/optional/facets.facet.status.yml index 063fdbc2e..3f97d0494 100644 --- a/modules/thunder_search/config/optional/facets.facet.status.yml +++ b/modules/thunder_search/config/optional/facets.facet.status.yml @@ -59,6 +59,11 @@ processor_configs: weights: build: -10 settings: { } + hide_non_narrowing_result_processor: + processor_id: hide_non_narrowing_result_processor + weights: + build: 40 + settings: { } url_processor_handler: processor_id: url_processor_handler weights: From a30aded27e40c5576a11269cf2e40df81cdcd4da Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Mon, 29 Oct 2018 17:44:01 +0100 Subject: [PATCH 082/134] Fix comments --- .../config/optional/facets.facet.channel.yml | 2 +- .../optional/search_api.index.content.yml | 67 ++----------------- .../src/Plugin/views/area/FacetBlock.php | 42 ++++++++---- tests/src/Functional/ModuleUninstallTest.php | 9 ++- .../Integration/ConfigSelectorTest.php | 5 +- thunder.post_update.php | 15 +++-- 6 files changed, 58 insertions(+), 82 deletions(-) diff --git a/modules/thunder_search/config/optional/facets.facet.channel.yml b/modules/thunder_search/config/optional/facets.facet.channel.yml index 5b9bcecae..71b3381a2 100644 --- a/modules/thunder_search/config/optional/facets.facet.channel.yml +++ b/modules/thunder_search/config/optional/facets.facet.channel.yml @@ -21,7 +21,7 @@ widget: width: 100% autocomplete: false match_operator: CONTAINS -query_operator: or +query_operator: and use_hierarchy: true expand_hierarchy: true enable_parent_when_child_gets_disabled: true diff --git a/modules/thunder_search/config/optional/search_api.index.content.yml b/modules/thunder_search/config/optional/search_api.index.content.yml index 000345c0c..4f007e91e 100644 --- a/modules/thunder_search/config/optional/search_api.index.content.yml +++ b/modules/thunder_search/config/optional/search_api.index.content.yml @@ -1,16 +1,16 @@ langcode: en status: true dependencies: - module: - - node - - user - - media_entity - - taxonomy - - search_api config: - field.storage.node.field_channel - field.storage.node.field_tags - search_api.server.database + module: + - media_entity + - user + - node + - taxonomy + - search_api id: content name: Content description: '' @@ -241,50 +241,6 @@ processor_settings: preprocess_index: -20 preprocess_query: -20 rendered_item: { } - stopwords: - all_fields: true - fields: - - label - - rendered_item - stopwords: - - a - - an - - and - - are - - as - - at - - be - - but - - by - - for - - if - - in - - into - - is - - it - - 'no' - - not - - of - - 'on' - - or - - s - - such - - t - - that - - the - - their - - then - - there - - these - - they - - this - - to - - was - - will - - with - weights: - preprocess_index: -5 - preprocess_query: -2 tokenizer: all_fields: true fields: @@ -296,17 +252,6 @@ processor_settings: weights: preprocess_index: -6 preprocess_query: -6 - transliteration: - all_fields: true - fields: - - label - - media_author - - name - - rendered_item - - type - weights: - preprocess_index: -20 - preprocess_query: -20 tracker_settings: default: indexing_order: fifo diff --git a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php index a70c9f8b9..71a280c75 100644 --- a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php +++ b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php @@ -2,7 +2,10 @@ namespace Drupal\thunder_search\Plugin\views\area; +use Drupal\facets\FacetManager\DefaultFacetManager; +use Drupal\facets\FacetSource\FacetSourcePluginManager; use Drupal\views\Plugin\views\area\AreaPluginBase; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * Views area handler to display some configurable result summary. @@ -13,32 +16,47 @@ */ class FacetBlock extends AreaPluginBase { + protected $facetManager; + + protected $facetSourceManager; + /** * {@inheritdoc} */ - public function render($empty = FALSE) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, DefaultFacetManager $facetManager, FacetSourcePluginManager $facetSourceManager) { + parent::__construct($configuration, $plugin_id, $plugin_definition); + $this->facetManager = $facetManager; + $this->facetSourceManager = $facetSourceManager; + } - /** @var \Drupal\facets\FacetManager\DefaultFacetManager $facetManager */ - $facetManager = \Drupal::service('facets.manager'); + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return parent::create($container, $configuration, $plugin_id, $plugin_definition, $container->get('facets.manager'), $container->get('plugin.manager.facets.facet_source')); + } - /** @var \Drupal\facets\FacetSource\FacetSourcePluginManager $source */ - $sources = \Drupal::service('plugin.manager.facets.facet_source'); + /** + * {@inheritdoc} + */ + public function render($empty = FALSE) { $facet_source = NULL; - foreach ($sources->getDefinitions() as $definition) { + foreach ($this->facetSourceManager->getDefinitions() as $definition) { /** @var \Drupal\facets\Plugin\facets\facet_source\SearchApiDisplay $source */ - $source = $sources->createInstance($definition['id']); + $source = $this->facetSourceManager->createInstance($definition['id']); if ($this->view->id() == $source->getViewsDisplay()->id() && $this->view->current_display == $source->getViewsDisplay()->current_display) { $facet_source = $source; } } - if (!$facet_source || !$this->view->result) { - return []; - } $build = ['#type' => 'container', '#attributes' => ['class' => 'form--inline clearfix']]; $build['_view'] = $this->view->display_handler->viewExposedFormBlocks(); - foreach ($facetManager->getFacetsByFacetSourceId($facet_source->pluginId) as $id => $facet) { + + if (!$facet_source || !$this->view->result) { + return $build; + } + foreach ($this->facetManager->getFacetsByFacetSourceId($facet_source->pluginId) as $id => $facet) { // No need to build the facet if it does not need to be visible. if (($facet->getOnlyVisibleWhenFacetSourceIsVisible() && !$facet->getFacetSource()->isRenderedInCurrentRequest())) { continue; @@ -46,7 +64,7 @@ public function render($empty = FALSE) { $config = $facet->getFacetSource()->getDisplay()->getPluginDefinition(); if ($config['view_id'] == $this->view->id() && $config['view_display'] == $this->view->current_display) { - $built_facet = $facetManager->build($facet); + $built_facet = $this->facetManager->build($facet); if (!in_array('facet-empty', $built_facet[0]['#attributes']['class'])) { $build['facets'][$id] = [ '#type' => 'container', diff --git a/tests/src/Functional/ModuleUninstallTest.php b/tests/src/Functional/ModuleUninstallTest.php index a5e24ad22..cf3c5cecb 100644 --- a/tests/src/Functional/ModuleUninstallTest.php +++ b/tests/src/Functional/ModuleUninstallTest.php @@ -35,7 +35,14 @@ class ModuleUninstallTest extends ThunderTestBase { ['length_indicator'], ['redirect'], ['simple_sitemap'], - ['thunder_search', 'search_api_db', 'search_api', 'facets'], + [ + 'thunder_search', + 'search_api_db', + 'search_api', + 'facets', + 'views_bulk_operations', + 'select2_facets', + ], // ['amp'], // Patch provided: https://www.drupal.org/files/issues/2901581_3.patch. diff --git a/tests/src/FunctionalJavascript/Integration/ConfigSelectorTest.php b/tests/src/FunctionalJavascript/Integration/ConfigSelectorTest.php index df5d91ed2..15bbd5958 100644 --- a/tests/src/FunctionalJavascript/Integration/ConfigSelectorTest.php +++ b/tests/src/FunctionalJavascript/Integration/ConfigSelectorTest.php @@ -28,7 +28,8 @@ public function testContentViewSearchApi() { $assert_session->elementExists('css', '#block-thunder-admin-content > div > div.view-content'); // Install thunder_search. - \Drupal::service('module_installer')->install(['thunder_search']); + $module_installer = \Drupal::service('module_installer'); + $module_installer->install(['thunder_search']); // Now we have a search_api based view. $this->drupalGet('admin/config/search/search-api/index/content'); @@ -40,7 +41,7 @@ public function testContentViewSearchApi() { $assert_session->elementExists('css', '#block-thunder-admin-content > div > div.view-content-search-api'); // Uninstall search_api. - \Drupal::service('module_installer')->uninstall(['thunder_search', 'search_api']); + $module_installer->uninstall(['thunder_search', 'search_api']); drupal_flush_all_caches(); // The normal view is back. diff --git a/thunder.post_update.php b/thunder.post_update.php index 54f538857..f06e88efd 100644 --- a/thunder.post_update.php +++ b/thunder.post_update.php @@ -22,11 +22,16 @@ function thunder_post_update_add_config_selector_to_content_media() { if ($view = View::load('thunder_media')) { $view->save(); } - /** @var \Drupal\config_update\ConfigReverter $configReverter */ - $configReverter = \Drupal::service('config_update.config_update'); - $configReverter->import('config_selector_feature', 'thunder_content_view'); - $configReverter->import('config_selector_feature', 'thunder_media_view'); - $thunderUpdater->checklist()->markUpdatesSuccessful(['thunder_add_config_selector_to_content_media']); + try { + /** @var \Drupal\config_update\ConfigReverter $configReverter */ + $configReverter = \Drupal::service('config_update.config_update'); + $configReverter->import('config_selector_feature', 'thunder_content_view'); + $configReverter->import('config_selector_feature', 'thunder_media_view'); + $thunderUpdater->checklist()->markUpdatesSuccessful(['thunder_add_config_selector_to_content_media']); + } + catch (\Exception $exception) { + $thunderUpdater->checklist()->markUpdatesFailed(['thunder_add_config_selector_to_content_media']); + } } else { $thunderUpdater->checklist()->markUpdatesFailed(['thunder_add_config_selector_to_content_media']); From 8e95a3cea5c04b7ca2014b21bc90f03105e7a8ad Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 30 Oct 2018 13:54:10 +0100 Subject: [PATCH 083/134] WIP --- .../src/Plugin/views/area/FacetBlock.php | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php index 71a280c75..c2f689ee6 100644 --- a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php +++ b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php @@ -33,7 +33,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return parent::create($container, $configuration, $plugin_id, $plugin_definition, $container->get('facets.manager'), $container->get('plugin.manager.facets.facet_source')); + return new static($configuration, $plugin_id, $plugin_definition, $container->get('facets.manager'), $container->get('plugin.manager.facets.facet_source')); } /** @@ -63,24 +63,25 @@ public function render($empty = FALSE) { } $config = $facet->getFacetSource()->getDisplay()->getPluginDefinition(); - if ($config['view_id'] == $this->view->id() && $config['view_display'] == $this->view->current_display) { - $built_facet = $this->facetManager->build($facet); - if (!in_array('facet-empty', $built_facet[0]['#attributes']['class'])) { - $build['facets'][$id] = [ - '#type' => 'container', - '#attributes' => ['class' => 'form-item'], - 'label' => [ - '#type' => 'label', - '#title' => $facet->label(), - '#title_display' => 'above', - ], - 'element' => $built_facet, - '#weight' => $facet->getWeight(), - ]; - } + if ($config['view_id'] != $this->view->id() || $config['view_display'] != $this->view->current_display) { + continue; + } + $built_facet = $this->facetManager->build($facet); + if (in_array('facet-empty', $built_facet[0]['#attributes']['class'])) { + continue; } + $build['facets'][$id] = [ + '#type' => 'container', + '#attributes' => ['class' => 'form-item'], + 'label' => [ + '#type' => 'label', + '#title' => $facet->label(), + '#title_display' => 'above', + ], + 'element' => $built_facet, + '#weight' => $facet->getWeight(), + ]; } - // Return as render array. return $build; } From 134c8babbc071c07f2aa408a3299c5c602f6818a Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 6 Nov 2018 14:58:18 +0100 Subject: [PATCH 084/134] Add patches --- composer.json | 3 ++- drupal-org.make | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 50adf312d..912860593 100644 --- a/composer.json +++ b/composer.json @@ -75,7 +75,8 @@ "Support entity 'operations' in Views": "https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch" }, "drupal/scheduler": { - "Scheduler integration with core Content moderation": "https://www.drupal.org/files/issues/2018-08-02/2798689-102.patch" + "Scheduler integration with core Content moderation": "https://www.drupal.org/files/issues/2018-08-02/2798689-102.patch", + "VBO on a Search API view with facets didn't work": "https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch" }, "drupal/views_bulk_operations": { "Fatal error when executing simple actions on Adminimal theme": "https://www.drupal.org/files/issues/2018-09-19/views_bulk_operations-theme_error-2952498-29.patch" diff --git a/drupal-org.make b/drupal-org.make index 0de19df9a..1a3325bcb 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -103,6 +103,7 @@ projects[redirect][version] = 1 projects[search_api][type] = module projects[search_api][version] = 1.10 projects[search_api][patch][] = https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch +projects[search_api][patch][] = https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch projects[scheduler][type] = module projects[scheduler][version] = 1.0 projects[scheduler][patch][] = "https://www.drupal.org/files/issues/2018-08-02/2798689-102.patch" @@ -132,7 +133,8 @@ projects[infinite][type] = theme projects[infinite][download][url] = http://git.drupal.org/sandbox/gos77/2677750.git projects[infinite][download][tag] = 8.x-1.0-beta7 projects[views_bulk_operations][type] = module -projects[views_bulk_operations][version] = 2 +projects[views_bulk_operations][version] = 2.4 +projects[views_bulk_operations][patch][] = https://www.drupal.org/files/issues/2018-09-19/views_bulk_operations-theme_error-2952498-29.patch projects[video_embed_field][type] = module projects[video_embed_field][version] = 1 projects[views_load_more][type] = module From 00a17dcc6544bb80966ca640123ded0a2e74b734 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 6 Nov 2018 15:15:13 +0100 Subject: [PATCH 085/134] Add patch to correct module --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 912860593..ee35a30e8 100644 --- a/composer.json +++ b/composer.json @@ -72,11 +72,11 @@ "Provide inline entity form FieldWidgetDisplay": "https://www.drupal.org/files/issues/2858438_6.patch" }, "drupal/search_api": { - "Support entity 'operations' in Views": "https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch" + "Support entity 'operations' in Views": "https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch", + "VBO on a Search API view with facets didn't work": "https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch" }, "drupal/scheduler": { - "Scheduler integration with core Content moderation": "https://www.drupal.org/files/issues/2018-08-02/2798689-102.patch", - "VBO on a Search API view with facets didn't work": "https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch" + "Scheduler integration with core Content moderation": "https://www.drupal.org/files/issues/2018-08-02/2798689-102.patch" }, "drupal/views_bulk_operations": { "Fatal error when executing simple actions on Adminimal theme": "https://www.drupal.org/files/issues/2018-09-19/views_bulk_operations-theme_error-2952498-29.patch" From 9d9d072e7b5479093f8d1b0deacec741a268410a Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 6 Nov 2018 17:36:35 +0100 Subject: [PATCH 086/134] Show numbers --- modules/thunder_search/config/optional/facets.facet.author.yml | 2 +- modules/thunder_search/config/optional/facets.facet.channel.yml | 2 +- .../config/optional/facets.facet.media_status.yml | 2 +- .../thunder_search/config/optional/facets.facet.media_type.yml | 2 +- .../config/optional/facets.facet.promoted_to_front_page.yml | 2 +- modules/thunder_search/config/optional/facets.facet.status.yml | 2 +- .../config/optional/facets.facet.sticky_at_top_of_lists.yml | 2 +- modules/thunder_search/config/optional/facets.facet.tags.yml | 2 +- modules/thunder_search/config/optional/facets.facet.type.yml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/thunder_search/config/optional/facets.facet.author.yml b/modules/thunder_search/config/optional/facets.facet.author.yml index 0c7f87123..7251d798d 100644 --- a/modules/thunder_search/config/optional/facets.facet.author.yml +++ b/modules/thunder_search/config/optional/facets.facet.author.yml @@ -17,7 +17,7 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: - show_numbers: false + show_numbers: true width: 100% autocomplete: false match_operator: CONTAINS diff --git a/modules/thunder_search/config/optional/facets.facet.channel.yml b/modules/thunder_search/config/optional/facets.facet.channel.yml index 71b3381a2..c6032bc7b 100644 --- a/modules/thunder_search/config/optional/facets.facet.channel.yml +++ b/modules/thunder_search/config/optional/facets.facet.channel.yml @@ -17,7 +17,7 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: - show_numbers: false + show_numbers: true width: 100% autocomplete: false match_operator: CONTAINS diff --git a/modules/thunder_search/config/optional/facets.facet.media_status.yml b/modules/thunder_search/config/optional/facets.facet.media_status.yml index 10fc291b5..55c2eb7c4 100644 --- a/modules/thunder_search/config/optional/facets.facet.media_status.yml +++ b/modules/thunder_search/config/optional/facets.facet.media_status.yml @@ -17,7 +17,7 @@ facet_source_id: 'search_api:views_page__media_search_api__page_1' widget: type: select2 config: - show_numbers: false + show_numbers: true width: 100% autocomplete: false match_operator: CONTAINS diff --git a/modules/thunder_search/config/optional/facets.facet.media_type.yml b/modules/thunder_search/config/optional/facets.facet.media_type.yml index 1fdbc0560..0890fdf59 100644 --- a/modules/thunder_search/config/optional/facets.facet.media_type.yml +++ b/modules/thunder_search/config/optional/facets.facet.media_type.yml @@ -17,7 +17,7 @@ facet_source_id: 'search_api:views_page__media_search_api__page_1' widget: type: select2 config: - show_numbers: false + show_numbers: true width: 100% autocomplete: false match_operator: CONTAINS diff --git a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml index 5203adc7f..f2ee8e4f9 100644 --- a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml +++ b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml @@ -17,7 +17,7 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: - show_numbers: false + show_numbers: true width: 100% autocomplete: false match_operator: CONTAINS diff --git a/modules/thunder_search/config/optional/facets.facet.status.yml b/modules/thunder_search/config/optional/facets.facet.status.yml index 3f97d0494..fd546767b 100644 --- a/modules/thunder_search/config/optional/facets.facet.status.yml +++ b/modules/thunder_search/config/optional/facets.facet.status.yml @@ -17,7 +17,7 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: - show_numbers: false + show_numbers: true width: 100% autocomplete: false match_operator: CONTAINS diff --git a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml index aa63c7a40..ec38c8c35 100644 --- a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml +++ b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml @@ -17,7 +17,7 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: - show_numbers: false + show_numbers: true width: 100% autocomplete: false match_operator: CONTAINS diff --git a/modules/thunder_search/config/optional/facets.facet.tags.yml b/modules/thunder_search/config/optional/facets.facet.tags.yml index 7229a20da..77245d544 100644 --- a/modules/thunder_search/config/optional/facets.facet.tags.yml +++ b/modules/thunder_search/config/optional/facets.facet.tags.yml @@ -17,7 +17,7 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: - show_numbers: false + show_numbers: true width: 300px autocomplete: true match_operator: CONTAINS diff --git a/modules/thunder_search/config/optional/facets.facet.type.yml b/modules/thunder_search/config/optional/facets.facet.type.yml index d028b46e9..a8300d735 100644 --- a/modules/thunder_search/config/optional/facets.facet.type.yml +++ b/modules/thunder_search/config/optional/facets.facet.type.yml @@ -17,7 +17,7 @@ facet_source_id: 'search_api:views_page__content_search_api__page_1' widget: type: select2 config: - show_numbers: false + show_numbers: true width: 100% autocomplete: false match_operator: CONTAINS From d34f2bd6dba204928577963f6a64f0590a6d04e5 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 7 Nov 2018 14:50:17 +0100 Subject: [PATCH 087/134] Change width --- .../config/optional/facets.facet.author.yml | 2 +- .../config/optional/facets.facet.channel.yml | 2 +- .../optional/facets.facet.media_status.yml | 2 +- .../optional/facets.facet.media_type.yml | 2 +- .../config/optional/facets.facet.status.yml | 2 +- .../config/optional/facets.facet.type.yml | 2 +- .../src/Plugin/views/area/FacetBlock.php | 19 ++++++++----------- 7 files changed, 14 insertions(+), 17 deletions(-) diff --git a/modules/thunder_search/config/optional/facets.facet.author.yml b/modules/thunder_search/config/optional/facets.facet.author.yml index 7251d798d..a7f19a196 100644 --- a/modules/thunder_search/config/optional/facets.facet.author.yml +++ b/modules/thunder_search/config/optional/facets.facet.author.yml @@ -18,7 +18,7 @@ widget: type: select2 config: show_numbers: true - width: 100% + width: resolve autocomplete: false match_operator: CONTAINS query_operator: or diff --git a/modules/thunder_search/config/optional/facets.facet.channel.yml b/modules/thunder_search/config/optional/facets.facet.channel.yml index c6032bc7b..365358a57 100644 --- a/modules/thunder_search/config/optional/facets.facet.channel.yml +++ b/modules/thunder_search/config/optional/facets.facet.channel.yml @@ -18,7 +18,7 @@ widget: type: select2 config: show_numbers: true - width: 100% + width: resolve autocomplete: false match_operator: CONTAINS query_operator: and diff --git a/modules/thunder_search/config/optional/facets.facet.media_status.yml b/modules/thunder_search/config/optional/facets.facet.media_status.yml index 55c2eb7c4..f5dc7c267 100644 --- a/modules/thunder_search/config/optional/facets.facet.media_status.yml +++ b/modules/thunder_search/config/optional/facets.facet.media_status.yml @@ -18,7 +18,7 @@ widget: type: select2 config: show_numbers: true - width: 100% + width: resolve autocomplete: false match_operator: CONTAINS query_operator: or diff --git a/modules/thunder_search/config/optional/facets.facet.media_type.yml b/modules/thunder_search/config/optional/facets.facet.media_type.yml index 0890fdf59..a691ef3c7 100644 --- a/modules/thunder_search/config/optional/facets.facet.media_type.yml +++ b/modules/thunder_search/config/optional/facets.facet.media_type.yml @@ -18,7 +18,7 @@ widget: type: select2 config: show_numbers: true - width: 100% + width: resolve autocomplete: false match_operator: CONTAINS query_operator: or diff --git a/modules/thunder_search/config/optional/facets.facet.status.yml b/modules/thunder_search/config/optional/facets.facet.status.yml index fd546767b..742c3669b 100644 --- a/modules/thunder_search/config/optional/facets.facet.status.yml +++ b/modules/thunder_search/config/optional/facets.facet.status.yml @@ -18,7 +18,7 @@ widget: type: select2 config: show_numbers: true - width: 100% + width: resolve autocomplete: false match_operator: CONTAINS query_operator: or diff --git a/modules/thunder_search/config/optional/facets.facet.type.yml b/modules/thunder_search/config/optional/facets.facet.type.yml index a8300d735..1e85c446c 100644 --- a/modules/thunder_search/config/optional/facets.facet.type.yml +++ b/modules/thunder_search/config/optional/facets.facet.type.yml @@ -18,7 +18,7 @@ widget: type: select2 config: show_numbers: true - width: 100% + width: resolve autocomplete: false match_operator: CONTAINS query_operator: or diff --git a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php index c2f689ee6..59278701c 100644 --- a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php +++ b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php @@ -50,8 +50,12 @@ public function render($empty = FALSE) { } } - $build = ['#type' => 'container', '#attributes' => ['class' => 'form--inline clearfix']]; - $build['_view'] = $this->view->display_handler->viewExposedFormBlocks(); + $build = [ + '#type' => 'container', + '#attributes' => ['class' => 'form--inline clearfix'], + 'exposed_form' => $this->view->display_handler->viewExposedFormBlocks(), + ]; + $build['exposed_form']['#attributes']['class'][] = 'form-item'; if (!$facet_source || !$this->view->result) { return $build; @@ -70,15 +74,8 @@ public function render($empty = FALSE) { if (in_array('facet-empty', $built_facet[0]['#attributes']['class'])) { continue; } - $build['facets'][$id] = [ - '#type' => 'container', - '#attributes' => ['class' => 'form-item'], - 'label' => [ - '#type' => 'label', - '#title' => $facet->label(), - '#title_display' => 'above', - ], - 'element' => $built_facet, + $build['facets'][$id] = $built_facet[0] + [ + '#title' => $facet->getName(), '#weight' => $facet->getWeight(), ]; } From 4e5fe5b30e9effbdc52a11285d53906fa1d051ce Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 7 Nov 2018 17:04:27 +0100 Subject: [PATCH 088/134] Cache views --- .../config/optional/views.view.content_search_api.yml | 6 ++---- .../config/optional/views.view.media_search_api.yml | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/modules/thunder_search/config/optional/views.view.content_search_api.yml b/modules/thunder_search/config/optional/views.view.content_search_api.yml index c6319e41b..6d5b04c3f 100644 --- a/modules/thunder_search/config/optional/views.view.content_search_api.yml +++ b/modules/thunder_search/config/optional/views.view.content_search_api.yml @@ -37,7 +37,7 @@ display: options: perm: 'access content overview' cache: - type: none + type: search_api_tag options: { } query: type: search_api_query @@ -917,10 +917,8 @@ display: description: 'Find and manage content' weight: -10 display_extenders: { } - cache: - type: none defaults: - cache: false + cache: true exposed_block: true display_plugin: page display_title: Page diff --git a/modules/thunder_search/config/optional/views.view.media_search_api.yml b/modules/thunder_search/config/optional/views.view.media_search_api.yml index 219f7d325..d1c9ab44d 100644 --- a/modules/thunder_search/config/optional/views.view.media_search_api.yml +++ b/modules/thunder_search/config/optional/views.view.media_search_api.yml @@ -37,7 +37,7 @@ display: options: perm: 'access content overview' cache: - type: none + type: search_api_tag options: { } query: type: search_api_query @@ -879,10 +879,8 @@ display: description: 'Find and manage content' weight: -10 display_extenders: { } - cache: - type: none defaults: - cache: false + cache: true exposed_block: true display_plugin: page display_title: Page From a30a5f224168ebd2e1bee6dd258a7f06a68810f5 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 8 Nov 2018 15:20:07 +0100 Subject: [PATCH 089/134] Update views --- .../views.view.content_search_api.yml | 28 +++++++++++++++++-- .../optional/views.view.media_search_api.yml | 28 +++++++++++++++++-- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/modules/thunder_search/config/optional/views.view.content_search_api.yml b/modules/thunder_search/config/optional/views.view.content_search_api.yml index 6d5b04c3f..3326ca1d5 100644 --- a/modules/thunder_search/config/optional/views.view.content_search_api.yml +++ b/modules/thunder_search/config/optional/views.view.content_search_api.yml @@ -146,7 +146,7 @@ display: separator: '' empty_column: false responsive: '' - default: node_changed + default: '-1' empty_table: false row: type: fields @@ -839,7 +839,31 @@ display: relationship: none group_type: group admin_label: '' - order: ASC + order: DESC + exposed: false + expose: + label: '' + plugin_id: search_api + node_changed: + id: node_changed + table: search_api_index_content + field: node_changed + relationship: none + group_type: group + admin_label: '' + order: DESC + exposed: false + expose: + label: '' + plugin_id: search_api + search_api_id: + id: search_api_id + table: search_api_index_content + field: search_api_id + relationship: none + group_type: group + admin_label: '' + order: DESC exposed: false expose: label: '' diff --git a/modules/thunder_search/config/optional/views.view.media_search_api.yml b/modules/thunder_search/config/optional/views.view.media_search_api.yml index d1c9ab44d..eba45de96 100644 --- a/modules/thunder_search/config/optional/views.view.media_search_api.yml +++ b/modules/thunder_search/config/optional/views.view.media_search_api.yml @@ -144,7 +144,7 @@ display: separator: '' empty_column: false responsive: '' - default: media_changed + default: '-1' empty_table: false row: type: fields @@ -802,7 +802,31 @@ display: relationship: none group_type: group admin_label: '' - order: ASC + order: DESC + exposed: false + expose: + label: '' + plugin_id: search_api + media_changed: + id: media_changed + table: search_api_index_content + field: media_changed + relationship: none + group_type: group + admin_label: '' + order: DESC + exposed: false + expose: + label: '' + plugin_id: search_api + search_api_id: + id: search_api_id + table: search_api_index_content + field: search_api_id + relationship: none + group_type: group + admin_label: '' + order: DESC exposed: false expose: label: '' From eaf714fda7e958eb3059dfa030af3df6888433ff Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 8 Nov 2018 16:50:28 +0100 Subject: [PATCH 090/134] Remove empty behavior --- .../views.view.content_search_api.yml | 15 +------------ .../optional/views.view.media_search_api.yml | 15 +------------ modules/thunder_search/thunder_search.module | 21 +++++++++++++++++++ 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/modules/thunder_search/config/optional/views.view.content_search_api.yml b/modules/thunder_search/config/optional/views.view.content_search_api.yml index 3326ca1d5..b70b4fc4f 100644 --- a/modules/thunder_search/config/optional/views.view.content_search_api.yml +++ b/modules/thunder_search/config/optional/views.view.content_search_api.yml @@ -890,20 +890,7 @@ display: empty: false plugin_id: facet_block footer: { } - empty: - area: - id: area - table: views - field: area - relationship: none - group_type: group - admin_label: '' - empty: true - tokenize: false - content: - value: 'It''s needed to index the search index in order to have all content searchable.' - format: basic_html - plugin_id: text + empty: { } relationships: { } arguments: { } display_extenders: { } diff --git a/modules/thunder_search/config/optional/views.view.media_search_api.yml b/modules/thunder_search/config/optional/views.view.media_search_api.yml index eba45de96..c3268ac5c 100644 --- a/modules/thunder_search/config/optional/views.view.media_search_api.yml +++ b/modules/thunder_search/config/optional/views.view.media_search_api.yml @@ -853,20 +853,7 @@ display: empty: false plugin_id: facet_block footer: { } - empty: - area: - id: area - table: views - field: area - relationship: none - group_type: group - admin_label: '' - empty: true - tokenize: false - content: - value: 'It''s needed to index the search index in order to have all media items searchable.' - format: basic_html - plugin_id: text + empty: { } relationships: { } arguments: { } display_extenders: { } diff --git a/modules/thunder_search/thunder_search.module b/modules/thunder_search/thunder_search.module index 888d51f7f..2618ac5f1 100644 --- a/modules/thunder_search/thunder_search.module +++ b/modules/thunder_search/thunder_search.module @@ -5,6 +5,9 @@ * Contains hook integrations. */ +use Drupal\search_api\Plugin\views\query\SearchApiQuery; +use Drupal\views\ViewExecutable; + /** * Implements hook_views_data(). */ @@ -18,3 +21,21 @@ function thunder_search_views_data() { ]; return $data; } + +/** + * Implements hook_views_pre_render(). + */ +function thunder_search_views_pre_render(ViewExecutable $view) { + if ($view->result || !$view->query instanceof SearchApiQuery) { + return; + } + + /** @var \Drupal\search_api\Task\IndexTaskManagerInterface $index_task_manager */ + $index_task_manager = \Drupal::service('search_api.index_task_manager'); + + $index = $view->query->getIndex(); + if (!$index_task_manager->isTrackingComplete($index) || $index->getTrackerInstance()->getRemainingItemsCount()) { + \Drupal::messenger()->addError(t("It's needed to index the search index in order to have all content searchable.")); + } + +} From 98606a9a6c361a648429059b637bb68db5c8d2e2 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Fri, 9 Nov 2018 14:00:07 +0100 Subject: [PATCH 091/134] Add search_api_db as a soft dependency --- modules/thunder_search/thunder_search.info.yml | 2 +- thunder.profile | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/thunder_search/thunder_search.info.yml b/modules/thunder_search/thunder_search.info.yml index 25748b842..3485e0272 100644 --- a/modules/thunder_search/thunder_search.info.yml +++ b/modules/thunder_search/thunder_search.info.yml @@ -4,7 +4,7 @@ type: module core: 8.x dependencies: - facets:facets - - search_api:search_api_db + - search_api:search_api - select2:select2_facets - views_bulk_operations:views_bulk_operations package: Thunder diff --git a/thunder.profile b/thunder.profile index 860e6a6b9..3ce06b707 100644 --- a/thunder.profile +++ b/thunder.profile @@ -277,6 +277,9 @@ function thunder_modules_installed($modules) { \Drupal::service('module_installer')->install(['scheduler_content_moderation_integration']); } } + if (in_array('search_api', $modules)) { + \Drupal::service('module_installer')->install(['search_api_db']); + } // Move fields into form display. if (in_array('ivw_integration', $modules)) { From 7f2c832eb7bd148dfc1157c7529a5456aff65450 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Mon, 12 Nov 2018 16:14:02 +0100 Subject: [PATCH 092/134] Add new search api patch --- composer.json | 3 ++- drupal-org.make | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4d5fd9bcb..5cfedb1e7 100644 --- a/composer.json +++ b/composer.json @@ -73,7 +73,8 @@ }, "drupal/search_api": { "Support entity 'operations' in Views": "https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch", - "VBO on a Search API view with facets didn't work": "https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch" + "VBO on a Search API view with facets didn't work": "https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch", + "Facets are lost by Views on keyword search": "https://www.drupal.org/files/issues/2018-11-12/2378945-30-drupal8.patch" }, "drupal/scheduler": { "Scheduler integration with core Content moderation": "https://www.drupal.org/files/issues/2018-08-02/2798689-102.patch" diff --git a/drupal-org.make b/drupal-org.make index d3aa7f616..6fe6cb51c 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -104,6 +104,7 @@ projects[search_api][type] = module projects[search_api][version] = 1.10 projects[search_api][patch][] = https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch projects[search_api][patch][] = https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch +projects[search_api][patch][] = https://www.drupal.org/files/issues/2018-11-12/2378945-30-drupal8.patch projects[scheduler][type] = module projects[scheduler][version] = 1.0 projects[scheduler][patch][] = "https://www.drupal.org/files/issues/2018-08-02/2798689-102.patch" From 64387ffc5fa1307ac754979fbda90026415b0255 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Mon, 12 Nov 2018 17:36:52 +0100 Subject: [PATCH 093/134] Update patch --- composer.json | 2 +- drupal-org.make | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 5cfedb1e7..6622800c0 100644 --- a/composer.json +++ b/composer.json @@ -74,7 +74,7 @@ "drupal/search_api": { "Support entity 'operations' in Views": "https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch", "VBO on a Search API view with facets didn't work": "https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch", - "Facets are lost by Views on keyword search": "https://www.drupal.org/files/issues/2018-11-12/2378945-30-drupal8.patch" + "Facets are lost by Views on keyword search": "https://www.drupal.org/files/issues/2018-11-12/2378945-31-drupal8.patch" }, "drupal/scheduler": { "Scheduler integration with core Content moderation": "https://www.drupal.org/files/issues/2018-08-02/2798689-102.patch" diff --git a/drupal-org.make b/drupal-org.make index 6fe6cb51c..5c7c7a646 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -104,7 +104,7 @@ projects[search_api][type] = module projects[search_api][version] = 1.10 projects[search_api][patch][] = https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch projects[search_api][patch][] = https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch -projects[search_api][patch][] = https://www.drupal.org/files/issues/2018-11-12/2378945-30-drupal8.patch +projects[search_api][patch][] = https://www.drupal.org/files/issues/2018-11-12/2378945-31-drupal8.patch projects[scheduler][type] = module projects[scheduler][version] = 1.0 projects[scheduler][patch][] = "https://www.drupal.org/files/issues/2018-08-02/2798689-102.patch" From d18e3e1b847be2bf0a04ab3a156a833120783481 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 13 Nov 2018 11:39:50 +0100 Subject: [PATCH 094/134] Activate query preserving --- composer.json | 2 +- drupal-org.make | 2 +- .../config/optional/views.view.content_search_api.yml | 3 ++- .../config/optional/views.view.media_search_api.yml | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 6622800c0..e238081db 100644 --- a/composer.json +++ b/composer.json @@ -74,7 +74,7 @@ "drupal/search_api": { "Support entity 'operations' in Views": "https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch", "VBO on a Search API view with facets didn't work": "https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch", - "Facets are lost by Views on keyword search": "https://www.drupal.org/files/issues/2018-11-12/2378945-31-drupal8.patch" + "Facets are lost by Views on keyword search": "https://www.drupal.org/files/issues/2018-11-12/2378945-33-drupal8.patch" }, "drupal/scheduler": { "Scheduler integration with core Content moderation": "https://www.drupal.org/files/issues/2018-08-02/2798689-102.patch" diff --git a/drupal-org.make b/drupal-org.make index 5c7c7a646..56154d827 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -104,7 +104,7 @@ projects[search_api][type] = module projects[search_api][version] = 1.10 projects[search_api][patch][] = https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch projects[search_api][patch][] = https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch -projects[search_api][patch][] = https://www.drupal.org/files/issues/2018-11-12/2378945-31-drupal8.patch +projects[search_api][patch][] = https://www.drupal.org/files/issues/2018-11-12/2378945-33-drupal8.patch projects[scheduler][type] = module projects[scheduler][version] = 1.0 projects[scheduler][patch][] = "https://www.drupal.org/files/issues/2018-08-02/2798689-102.patch" diff --git a/modules/thunder_search/config/optional/views.view.content_search_api.yml b/modules/thunder_search/config/optional/views.view.content_search_api.yml index b70b4fc4f..78e829921 100644 --- a/modules/thunder_search/config/optional/views.view.content_search_api.yml +++ b/modules/thunder_search/config/optional/views.view.content_search_api.yml @@ -42,8 +42,9 @@ display: query: type: search_api_query options: - bypass_access: false skip_access: false + bypass_access: false + preserve_facet_query_args: true exposed_form: type: basic options: diff --git a/modules/thunder_search/config/optional/views.view.media_search_api.yml b/modules/thunder_search/config/optional/views.view.media_search_api.yml index c3268ac5c..d9175a2ec 100644 --- a/modules/thunder_search/config/optional/views.view.media_search_api.yml +++ b/modules/thunder_search/config/optional/views.view.media_search_api.yml @@ -42,8 +42,9 @@ display: query: type: search_api_query options: - bypass_access: false skip_access: false + bypass_access: false + preserve_facet_query_args: true exposed_form: type: basic options: From e5dafedb2c470d857e48929708d7d69c3d426d65 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 13 Nov 2018 11:56:57 +0100 Subject: [PATCH 095/134] Add view classes --- .../config/optional/views.view.content_search_api.yml | 1 + .../config/optional/views.view.media_search_api.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/thunder_search/config/optional/views.view.content_search_api.yml b/modules/thunder_search/config/optional/views.view.content_search_api.yml index 78e829921..8c195e241 100644 --- a/modules/thunder_search/config/optional/views.view.content_search_api.yml +++ b/modules/thunder_search/config/optional/views.view.content_search_api.yml @@ -900,6 +900,7 @@ display: operator: AND groups: 1: AND + css_class: thunder-search-api cache_metadata: max-age: 0 contexts: diff --git a/modules/thunder_search/config/optional/views.view.media_search_api.yml b/modules/thunder_search/config/optional/views.view.media_search_api.yml index d9175a2ec..2871cfdab 100644 --- a/modules/thunder_search/config/optional/views.view.media_search_api.yml +++ b/modules/thunder_search/config/optional/views.view.media_search_api.yml @@ -863,6 +863,7 @@ display: operator: AND groups: 1: AND + css_class: thunder-search-api cache_metadata: max-age: 0 contexts: From 1bb37109765657ae44c5d9982e9b389d59c067ca Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 13 Nov 2018 14:12:48 +0100 Subject: [PATCH 096/134] Fix patch path --- composer.json | 2 +- drupal-org.make | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index e238081db..3a9152993 100644 --- a/composer.json +++ b/composer.json @@ -74,7 +74,7 @@ "drupal/search_api": { "Support entity 'operations' in Views": "https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch", "VBO on a Search API view with facets didn't work": "https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch", - "Facets are lost by Views on keyword search": "https://www.drupal.org/files/issues/2018-11-12/2378945-33-drupal8.patch" + "Facets are lost by Views on keyword search": "https://www.drupal.org/files/issues/2018-11-13/2378945-33-drupal8.patch" }, "drupal/scheduler": { "Scheduler integration with core Content moderation": "https://www.drupal.org/files/issues/2018-08-02/2798689-102.patch" diff --git a/drupal-org.make b/drupal-org.make index 56154d827..4c5cadcb6 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -104,7 +104,7 @@ projects[search_api][type] = module projects[search_api][version] = 1.10 projects[search_api][patch][] = https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch projects[search_api][patch][] = https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch -projects[search_api][patch][] = https://www.drupal.org/files/issues/2018-11-12/2378945-33-drupal8.patch +projects[search_api][patch][] = https://www.drupal.org/files/issues/2018-11-13/2378945-33-drupal8.patch projects[scheduler][type] = module projects[scheduler][version] = 1.0 projects[scheduler][patch][] = "https://www.drupal.org/files/issues/2018-08-02/2798689-102.patch" From af70c518bd20d1ff3a058d7a9c39c676f1b70ab6 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 14 Nov 2018 10:41:08 +0100 Subject: [PATCH 097/134] Show titles with config --- modules/thunder_search/config/optional/facets.facet.author.yml | 2 +- .../thunder_search/config/optional/facets.facet.channel.yml | 2 +- .../config/optional/facets.facet.media_status.yml | 2 +- .../thunder_search/config/optional/facets.facet.media_type.yml | 2 +- .../config/optional/facets.facet.promoted_to_front_page.yml | 2 +- modules/thunder_search/config/optional/facets.facet.status.yml | 2 +- .../config/optional/facets.facet.sticky_at_top_of_lists.yml | 2 +- modules/thunder_search/config/optional/facets.facet.tags.yml | 2 +- modules/thunder_search/config/optional/facets.facet.type.yml | 2 +- modules/thunder_search/src/Plugin/views/area/FacetBlock.php | 3 +-- 10 files changed, 10 insertions(+), 11 deletions(-) diff --git a/modules/thunder_search/config/optional/facets.facet.author.yml b/modules/thunder_search/config/optional/facets.facet.author.yml index a7f19a196..2f40de361 100644 --- a/modules/thunder_search/config/optional/facets.facet.author.yml +++ b/modules/thunder_search/config/optional/facets.facet.author.yml @@ -65,4 +65,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: false +show_title: true diff --git a/modules/thunder_search/config/optional/facets.facet.channel.yml b/modules/thunder_search/config/optional/facets.facet.channel.yml index 365358a57..8b7f83093 100644 --- a/modules/thunder_search/config/optional/facets.facet.channel.yml +++ b/modules/thunder_search/config/optional/facets.facet.channel.yml @@ -70,4 +70,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: false +show_title: true diff --git a/modules/thunder_search/config/optional/facets.facet.media_status.yml b/modules/thunder_search/config/optional/facets.facet.media_status.yml index f5dc7c267..9041f57bb 100644 --- a/modules/thunder_search/config/optional/facets.facet.media_status.yml +++ b/modules/thunder_search/config/optional/facets.facet.media_status.yml @@ -72,4 +72,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: false +show_title: true diff --git a/modules/thunder_search/config/optional/facets.facet.media_type.yml b/modules/thunder_search/config/optional/facets.facet.media_type.yml index a691ef3c7..7f391f7aa 100644 --- a/modules/thunder_search/config/optional/facets.facet.media_type.yml +++ b/modules/thunder_search/config/optional/facets.facet.media_type.yml @@ -65,4 +65,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: false +show_title: true diff --git a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml index f2ee8e4f9..f43b8d627 100644 --- a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml +++ b/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml @@ -67,4 +67,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: false +show_title: true diff --git a/modules/thunder_search/config/optional/facets.facet.status.yml b/modules/thunder_search/config/optional/facets.facet.status.yml index 742c3669b..6cacaf9b1 100644 --- a/modules/thunder_search/config/optional/facets.facet.status.yml +++ b/modules/thunder_search/config/optional/facets.facet.status.yml @@ -72,4 +72,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: false +show_title: true diff --git a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml index ec38c8c35..897e0566a 100644 --- a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml +++ b/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml @@ -67,4 +67,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: false +show_title: true diff --git a/modules/thunder_search/config/optional/facets.facet.tags.yml b/modules/thunder_search/config/optional/facets.facet.tags.yml index 77245d544..1ddff11df 100644 --- a/modules/thunder_search/config/optional/facets.facet.tags.yml +++ b/modules/thunder_search/config/optional/facets.facet.tags.yml @@ -65,4 +65,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: false +show_title: true diff --git a/modules/thunder_search/config/optional/facets.facet.type.yml b/modules/thunder_search/config/optional/facets.facet.type.yml index 1e85c446c..afc14b0eb 100644 --- a/modules/thunder_search/config/optional/facets.facet.type.yml +++ b/modules/thunder_search/config/optional/facets.facet.type.yml @@ -60,4 +60,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: false +show_title: true diff --git a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php index 59278701c..660b37869 100644 --- a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php +++ b/modules/thunder_search/src/Plugin/views/area/FacetBlock.php @@ -74,8 +74,7 @@ public function render($empty = FALSE) { if (in_array('facet-empty', $built_facet[0]['#attributes']['class'])) { continue; } - $build['facets'][$id] = $built_facet[0] + [ - '#title' => $facet->getName(), + $build['facets'][$id] = $built_facet + [ '#weight' => $facet->getWeight(), ]; } From 28964ea3fda7727c494981fbefae32471d31f625 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 13 Dec 2018 13:33:53 +0100 Subject: [PATCH 098/134] Kill thunder_search --- .../optional/facets.facet.author.yml | 0 .../optional/facets.facet.channel.yml | 0 .../optional/facets.facet.media_status.yml | 0 .../optional/facets.facet.media_type.yml | 0 .../facets.facet.promoted_to_front_page.yml | 0 .../optional/facets.facet.status.yml | 0 .../facets.facet.sticky_at_top_of_lists.yml | 0 .../optional/facets.facet.tags.yml | 0 .../optional/facets.facet.type.yml | 0 ...views_page__content_search_api__page_1.yml | 0 ...__views_page__media_search_api__page_1.yml | 0 .../optional/search_api.index.content.yml | 0 .../optional/search_api.server.database.yml | 0 .../views.view.content_search_api.yml | 1 - .../optional/views.view.media_search_api.yml | 1 - .../thunder_search/thunder_search.info.yml | 10 ---- modules/thunder_search/thunder_search.install | 13 ------ modules/thunder_search/thunder_search.module | 41 ----------------- .../Thunder/OptionalModule/ThunderSearch.php | 2 +- .../Plugin/views/area/FacetBlock.php | 2 +- thunder.profile | 46 +++++++++++++++++-- 21 files changed, 45 insertions(+), 71 deletions(-) rename {modules/thunder_search/config => config}/optional/facets.facet.author.yml (100%) rename {modules/thunder_search/config => config}/optional/facets.facet.channel.yml (100%) rename {modules/thunder_search/config => config}/optional/facets.facet.media_status.yml (100%) rename {modules/thunder_search/config => config}/optional/facets.facet.media_type.yml (100%) rename {modules/thunder_search/config => config}/optional/facets.facet.promoted_to_front_page.yml (100%) rename {modules/thunder_search/config => config}/optional/facets.facet.status.yml (100%) rename {modules/thunder_search/config => config}/optional/facets.facet.sticky_at_top_of_lists.yml (100%) rename {modules/thunder_search/config => config}/optional/facets.facet.tags.yml (100%) rename {modules/thunder_search/config => config}/optional/facets.facet.type.yml (100%) rename {modules/thunder_search/config => config}/optional/facets.facet_source.search_api__views_page__content_search_api__page_1.yml (100%) rename {modules/thunder_search/config => config}/optional/facets.facet_source.search_api__views_page__media_search_api__page_1.yml (100%) rename {modules/thunder_search/config => config}/optional/search_api.index.content.yml (100%) rename {modules/thunder_search/config => config}/optional/search_api.server.database.yml (100%) rename {modules/thunder_search/config => config}/optional/views.view.content_search_api.yml (99%) rename {modules/thunder_search/config => config}/optional/views.view.media_search_api.yml (99%) delete mode 100644 modules/thunder_search/thunder_search.info.yml delete mode 100644 modules/thunder_search/thunder_search.install delete mode 100644 modules/thunder_search/thunder_search.module rename {modules/thunder_search/src => src}/Plugin/views/area/FacetBlock.php (98%) diff --git a/modules/thunder_search/config/optional/facets.facet.author.yml b/config/optional/facets.facet.author.yml similarity index 100% rename from modules/thunder_search/config/optional/facets.facet.author.yml rename to config/optional/facets.facet.author.yml diff --git a/modules/thunder_search/config/optional/facets.facet.channel.yml b/config/optional/facets.facet.channel.yml similarity index 100% rename from modules/thunder_search/config/optional/facets.facet.channel.yml rename to config/optional/facets.facet.channel.yml diff --git a/modules/thunder_search/config/optional/facets.facet.media_status.yml b/config/optional/facets.facet.media_status.yml similarity index 100% rename from modules/thunder_search/config/optional/facets.facet.media_status.yml rename to config/optional/facets.facet.media_status.yml diff --git a/modules/thunder_search/config/optional/facets.facet.media_type.yml b/config/optional/facets.facet.media_type.yml similarity index 100% rename from modules/thunder_search/config/optional/facets.facet.media_type.yml rename to config/optional/facets.facet.media_type.yml diff --git a/modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml b/config/optional/facets.facet.promoted_to_front_page.yml similarity index 100% rename from modules/thunder_search/config/optional/facets.facet.promoted_to_front_page.yml rename to config/optional/facets.facet.promoted_to_front_page.yml diff --git a/modules/thunder_search/config/optional/facets.facet.status.yml b/config/optional/facets.facet.status.yml similarity index 100% rename from modules/thunder_search/config/optional/facets.facet.status.yml rename to config/optional/facets.facet.status.yml diff --git a/modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml b/config/optional/facets.facet.sticky_at_top_of_lists.yml similarity index 100% rename from modules/thunder_search/config/optional/facets.facet.sticky_at_top_of_lists.yml rename to config/optional/facets.facet.sticky_at_top_of_lists.yml diff --git a/modules/thunder_search/config/optional/facets.facet.tags.yml b/config/optional/facets.facet.tags.yml similarity index 100% rename from modules/thunder_search/config/optional/facets.facet.tags.yml rename to config/optional/facets.facet.tags.yml diff --git a/modules/thunder_search/config/optional/facets.facet.type.yml b/config/optional/facets.facet.type.yml similarity index 100% rename from modules/thunder_search/config/optional/facets.facet.type.yml rename to config/optional/facets.facet.type.yml diff --git a/modules/thunder_search/config/optional/facets.facet_source.search_api__views_page__content_search_api__page_1.yml b/config/optional/facets.facet_source.search_api__views_page__content_search_api__page_1.yml similarity index 100% rename from modules/thunder_search/config/optional/facets.facet_source.search_api__views_page__content_search_api__page_1.yml rename to config/optional/facets.facet_source.search_api__views_page__content_search_api__page_1.yml diff --git a/modules/thunder_search/config/optional/facets.facet_source.search_api__views_page__media_search_api__page_1.yml b/config/optional/facets.facet_source.search_api__views_page__media_search_api__page_1.yml similarity index 100% rename from modules/thunder_search/config/optional/facets.facet_source.search_api__views_page__media_search_api__page_1.yml rename to config/optional/facets.facet_source.search_api__views_page__media_search_api__page_1.yml diff --git a/modules/thunder_search/config/optional/search_api.index.content.yml b/config/optional/search_api.index.content.yml similarity index 100% rename from modules/thunder_search/config/optional/search_api.index.content.yml rename to config/optional/search_api.index.content.yml diff --git a/modules/thunder_search/config/optional/search_api.server.database.yml b/config/optional/search_api.server.database.yml similarity index 100% rename from modules/thunder_search/config/optional/search_api.server.database.yml rename to config/optional/search_api.server.database.yml diff --git a/modules/thunder_search/config/optional/views.view.content_search_api.yml b/config/optional/views.view.content_search_api.yml similarity index 99% rename from modules/thunder_search/config/optional/views.view.content_search_api.yml rename to config/optional/views.view.content_search_api.yml index 8c195e241..16271df12 100644 --- a/modules/thunder_search/config/optional/views.view.content_search_api.yml +++ b/config/optional/views.view.content_search_api.yml @@ -10,7 +10,6 @@ dependencies: - config_selector - media_entity - search_api - - thunder_search - user - views_bulk_operations third_party_settings: diff --git a/modules/thunder_search/config/optional/views.view.media_search_api.yml b/config/optional/views.view.media_search_api.yml similarity index 99% rename from modules/thunder_search/config/optional/views.view.media_search_api.yml rename to config/optional/views.view.media_search_api.yml index 2871cfdab..a0d7bd4a3 100644 --- a/modules/thunder_search/config/optional/views.view.media_search_api.yml +++ b/config/optional/views.view.media_search_api.yml @@ -10,7 +10,6 @@ dependencies: - datetime - image - search_api - - thunder_search - user - views_bulk_operations third_party_settings: diff --git a/modules/thunder_search/thunder_search.info.yml b/modules/thunder_search/thunder_search.info.yml deleted file mode 100644 index 3485e0272..000000000 --- a/modules/thunder_search/thunder_search.info.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: 'Thunder Search' -description: 'Provides better search integration for Thunder.' -type: module -core: 8.x -dependencies: - - facets:facets - - search_api:search_api - - select2:select2_facets - - views_bulk_operations:views_bulk_operations -package: Thunder diff --git a/modules/thunder_search/thunder_search.install b/modules/thunder_search/thunder_search.install deleted file mode 100644 index 9d6396d30..000000000 --- a/modules/thunder_search/thunder_search.install +++ /dev/null @@ -1,13 +0,0 @@ -addStatus(t("It's needed to index the search index in order to have all content searchable.")); -} diff --git a/modules/thunder_search/thunder_search.module b/modules/thunder_search/thunder_search.module deleted file mode 100644 index 2618ac5f1..000000000 --- a/modules/thunder_search/thunder_search.module +++ /dev/null @@ -1,41 +0,0 @@ - t('Facet block'), - 'help' => t('.'), - 'area' => [ - 'id' => 'facet_block', - ], - ]; - return $data; -} - -/** - * Implements hook_views_pre_render(). - */ -function thunder_search_views_pre_render(ViewExecutable $view) { - if ($view->result || !$view->query instanceof SearchApiQuery) { - return; - } - - /** @var \Drupal\search_api\Task\IndexTaskManagerInterface $index_task_manager */ - $index_task_manager = \Drupal::service('search_api.index_task_manager'); - - $index = $view->query->getIndex(); - if (!$index_task_manager->isTrackingComplete($index) || $index->getTrackerInstance()->getRemainingItemsCount()) { - \Drupal::messenger()->addError(t("It's needed to index the search index in order to have all content searchable.")); - } - -} diff --git a/src/Plugin/Thunder/OptionalModule/ThunderSearch.php b/src/Plugin/Thunder/OptionalModule/ThunderSearch.php index f6cfe6306..b1676230b 100644 --- a/src/Plugin/Thunder/OptionalModule/ThunderSearch.php +++ b/src/Plugin/Thunder/OptionalModule/ThunderSearch.php @@ -6,7 +6,7 @@ * Thunder Search integration. * * @ThunderOptionalModule( - * id = "thunder_search", + * id = "search_api", * label = @Translation("Thunder Search integration"), * description = @Translation("Better search experience for editors and users"), * type = "module", diff --git a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php b/src/Plugin/views/area/FacetBlock.php similarity index 98% rename from modules/thunder_search/src/Plugin/views/area/FacetBlock.php rename to src/Plugin/views/area/FacetBlock.php index 660b37869..dd39537b5 100644 --- a/modules/thunder_search/src/Plugin/views/area/FacetBlock.php +++ b/src/Plugin/views/area/FacetBlock.php @@ -1,6 +1,6 @@ install(['scheduler_content_moderation_integration']); } } - if (in_array('search_api', $modules)) { - \Drupal::service('module_installer')->install(['search_api_db']); - } // Move fields into form display. if (in_array('ivw_integration', $modules)) { @@ -334,6 +333,15 @@ function thunder_modules_installed($modules) { \Drupal::service('messenger')->addStatus(t('The Password Character Length, Password Policy History and Password Character Types modules have been additionally enabled, they are required by the default policy configuration.')); } + // When enabling password policy, enabled required sub modules. + if (in_array('search_api', $modules)) { + \Drupal::service('module_installer')->install(['search_api_db']); + \Drupal::service('module_installer')->install(['facets']); + \Drupal::service('module_installer')->install(['select2_facets']); + \Drupal::service('module_installer')->install(['views_bulk_operations']); + \Drupal::messenger()->addStatus(t("It's needed to index the search index in order to have all content searchable.")); + } + } /** @@ -412,3 +420,35 @@ function thunder_field_widget_info_alter(array &$info) { unset($info['thunder_moderation_state_default']); } } + +/** + * Implements hook_views_data(). + */ +function thunder_views_data() { + $data['views']['facet_block'] = [ + 'title' => t('Facet block'), + 'help' => t('.'), + 'area' => [ + 'id' => 'facet_block', + ], + ]; + return $data; +} + +/** + * Implements hook_views_pre_render(). + */ +function thunder_views_pre_render(ViewExecutable $view) { + if ($view->result || !$view->query instanceof SearchApiQuery) { + return; + } + + /** @var \Drupal\search_api\Task\IndexTaskManagerInterface $index_task_manager */ + $index_task_manager = \Drupal::service('search_api.index_task_manager'); + + $index = $view->query->getIndex(); + if (!$index_task_manager->isTrackingComplete($index) || $index->getTrackerInstance()->getRemainingItemsCount()) { + \Drupal::messenger()->addError(t("It's needed to index the search index in order to have all content searchable.")); + } + +} From 6b10e70f0bce72444b2860ec0809738490ecaf1d Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 13 Dec 2018 13:36:24 +0100 Subject: [PATCH 099/134] Kill thunder_search leftovers --- tests/src/Functional/InstalledConfigurationTest.php | 2 +- tests/src/Functional/ModuleUninstallTest.php | 1 - .../FunctionalJavascript/Integration/ConfigSelectorTest.php | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/src/Functional/InstalledConfigurationTest.php b/tests/src/Functional/InstalledConfigurationTest.php index 66b8f281f..c06ee5db8 100644 --- a/tests/src/Functional/InstalledConfigurationTest.php +++ b/tests/src/Functional/InstalledConfigurationTest.php @@ -36,7 +36,7 @@ class InstalledConfigurationTest extends ThunderTestBase { 'thunder_riddle', 'harbourmaster', 'simple_gmap', - 'thunder_search', + 'search_api', // Additional modules. // 'thunder_fia', diff --git a/tests/src/Functional/ModuleUninstallTest.php b/tests/src/Functional/ModuleUninstallTest.php index cf3c5cecb..719e55050 100644 --- a/tests/src/Functional/ModuleUninstallTest.php +++ b/tests/src/Functional/ModuleUninstallTest.php @@ -36,7 +36,6 @@ class ModuleUninstallTest extends ThunderTestBase { ['redirect'], ['simple_sitemap'], [ - 'thunder_search', 'search_api_db', 'search_api', 'facets', diff --git a/tests/src/FunctionalJavascript/Integration/ConfigSelectorTest.php b/tests/src/FunctionalJavascript/Integration/ConfigSelectorTest.php index 15bbd5958..98a97437e 100644 --- a/tests/src/FunctionalJavascript/Integration/ConfigSelectorTest.php +++ b/tests/src/FunctionalJavascript/Integration/ConfigSelectorTest.php @@ -27,9 +27,9 @@ public function testContentViewSearchApi() { $assert_session->elementExists('xpath', '//*[@id="view-title-table-column"]/a'); $assert_session->elementExists('css', '#block-thunder-admin-content > div > div.view-content'); - // Install thunder_search. + // Install search_api. $module_installer = \Drupal::service('module_installer'); - $module_installer->install(['thunder_search']); + $module_installer->install(['search_api']); // Now we have a search_api based view. $this->drupalGet('admin/config/search/search-api/index/content'); @@ -41,7 +41,7 @@ public function testContentViewSearchApi() { $assert_session->elementExists('css', '#block-thunder-admin-content > div > div.view-content-search-api'); // Uninstall search_api. - $module_installer->uninstall(['thunder_search', 'search_api']); + $module_installer->uninstall(['search_api']); drupal_flush_all_caches(); // The normal view is back. From 1c17ccb1ed69262040eaad544af11e7d8be42714 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 13 Dec 2018 13:52:38 +0100 Subject: [PATCH 100/134] Update search_api --- composer.json | 2 +- drupal-org.make | 2 +- thunder.profile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 5ac9c230a..d9593de20 100644 --- a/composer.json +++ b/composer.json @@ -143,7 +143,7 @@ "drupal/redirect": "^1.0", "drupal/riddle_marketplace": "^2.0", "drupal/scheduler": "1.0", - "drupal/search_api": "1.10", + "drupal/search_api": "1.11", "drupal/select2": "^1.0", "drupal/simple_sitemap": "^2.0", "drupal/shariff": "^1.0", diff --git a/drupal-org.make b/drupal-org.make index f34544123..5ef02ac76 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -104,7 +104,7 @@ projects[riddle_marketplace][version] = 2 projects[redirect][type] = module projects[redirect][version] = 1 projects[search_api][type] = module -projects[search_api][version] = 1.10 +projects[search_api][version] = 1.11 projects[search_api][patch][] = https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch projects[search_api][patch][] = https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch projects[search_api][patch][] = https://www.drupal.org/files/issues/2018-11-13/2378945-33-drupal8.patch diff --git a/thunder.profile b/thunder.profile index 06a2f3780..fcba284a3 100644 --- a/thunder.profile +++ b/thunder.profile @@ -333,7 +333,7 @@ function thunder_modules_installed($modules) { \Drupal::service('messenger')->addStatus(t('The Password Character Length, Password Policy History and Password Character Types modules have been additionally enabled, they are required by the default policy configuration.')); } - // When enabling password policy, enabled required sub modules. + // When enabling search_api, enable facets and VBO. if (in_array('search_api', $modules)) { \Drupal::service('module_installer')->install(['search_api_db']); \Drupal::service('module_installer')->install(['facets']); From 4e917d052e8cb8fde41d8e38e3e06bc4846069e6 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 13 Dec 2018 15:39:14 +0100 Subject: [PATCH 101/134] Cleanup config --- config/optional/facets.facet.author.yml | 6 +- config/optional/facets.facet.channel.yml | 6 +- config/optional/facets.facet.media_status.yml | 6 +- config/optional/facets.facet.media_type.yml | 6 +- .../facets.facet.promoted_to_front_page.yml | 6 +- config/optional/facets.facet.status.yml | 6 +- .../facets.facet.sticky_at_top_of_lists.yml | 6 +- config/optional/facets.facet.tags.yml | 6 +- config/optional/facets.facet.type.yml | 6 +- config/optional/search_api.index.content.yml | 86 +++++++++---------- .../optional/search_api.server.database.yml | 2 +- config/optional/views.view.content.yml | 10 +-- .../views.view.content_search_api.yml | 47 +++++----- .../optional/views.view.media_search_api.yml | 43 +++++----- config/optional/views.view.thunder_media.yml | 10 +-- 15 files changed, 127 insertions(+), 125 deletions(-) diff --git a/config/optional/facets.facet.author.yml b/config/optional/facets.facet.author.yml index 2f40de361..e0640fc0d 100644 --- a/config/optional/facets.facet.author.yml +++ b/config/optional/facets.facet.author.yml @@ -2,10 +2,10 @@ langcode: en status: true dependencies: config: - - search_api.index.content - - views.view.content_search_api + - search_api.index.content + - views.view.content_search_api module: - - search_api + - search_api id: author name: Author url_alias: author diff --git a/config/optional/facets.facet.channel.yml b/config/optional/facets.facet.channel.yml index 8b7f83093..77ebb6407 100644 --- a/config/optional/facets.facet.channel.yml +++ b/config/optional/facets.facet.channel.yml @@ -2,10 +2,10 @@ langcode: en status: true dependencies: config: - - search_api.index.content - - views.view.content_search_api + - search_api.index.content + - views.view.content_search_api module: - - search_api + - search_api id: channel name: Channel url_alias: channel diff --git a/config/optional/facets.facet.media_status.yml b/config/optional/facets.facet.media_status.yml index 9041f57bb..c0cbce09b 100644 --- a/config/optional/facets.facet.media_status.yml +++ b/config/optional/facets.facet.media_status.yml @@ -2,10 +2,10 @@ langcode: en status: true dependencies: config: - - search_api.index.content - - views.view.media_search_api + - search_api.index.content + - views.view.media_search_api module: - - search_api + - search_api id: media_status name: Status url_alias: media_status diff --git a/config/optional/facets.facet.media_type.yml b/config/optional/facets.facet.media_type.yml index 7f391f7aa..6607c1419 100644 --- a/config/optional/facets.facet.media_type.yml +++ b/config/optional/facets.facet.media_type.yml @@ -2,10 +2,10 @@ langcode: en status: true dependencies: config: - - search_api.index.content - - views.view.media_search_api + - search_api.index.content + - views.view.media_search_api module: - - search_api + - search_api id: media_type name: Type url_alias: media_type diff --git a/config/optional/facets.facet.promoted_to_front_page.yml b/config/optional/facets.facet.promoted_to_front_page.yml index f43b8d627..dd0b7f5d4 100644 --- a/config/optional/facets.facet.promoted_to_front_page.yml +++ b/config/optional/facets.facet.promoted_to_front_page.yml @@ -2,10 +2,10 @@ langcode: en status: true dependencies: config: - - search_api.index.content - - views.view.content_search_api + - search_api.index.content + - views.view.content_search_api module: - - search_api + - search_api id: promoted_to_front_page name: Promoted url_alias: promoted_to_front_page diff --git a/config/optional/facets.facet.status.yml b/config/optional/facets.facet.status.yml index 6cacaf9b1..f7c829232 100644 --- a/config/optional/facets.facet.status.yml +++ b/config/optional/facets.facet.status.yml @@ -2,10 +2,10 @@ langcode: en status: true dependencies: config: - - search_api.index.content - - views.view.content_search_api + - search_api.index.content + - views.view.content_search_api module: - - search_api + - search_api id: status name: Status url_alias: status diff --git a/config/optional/facets.facet.sticky_at_top_of_lists.yml b/config/optional/facets.facet.sticky_at_top_of_lists.yml index 897e0566a..d35c70c0e 100644 --- a/config/optional/facets.facet.sticky_at_top_of_lists.yml +++ b/config/optional/facets.facet.sticky_at_top_of_lists.yml @@ -2,10 +2,10 @@ langcode: en status: true dependencies: config: - - search_api.index.content - - views.view.content_search_api + - search_api.index.content + - views.view.content_search_api module: - - search_api + - search_api id: sticky_at_top_of_lists name: Sticky url_alias: sticky_at_top_of_lists diff --git a/config/optional/facets.facet.tags.yml b/config/optional/facets.facet.tags.yml index 1ddff11df..d515f7715 100644 --- a/config/optional/facets.facet.tags.yml +++ b/config/optional/facets.facet.tags.yml @@ -2,10 +2,10 @@ langcode: en status: true dependencies: config: - - search_api.index.content - - views.view.content_search_api + - search_api.index.content + - views.view.content_search_api module: - - search_api + - search_api id: tags name: Tags url_alias: tags diff --git a/config/optional/facets.facet.type.yml b/config/optional/facets.facet.type.yml index afc14b0eb..7bad366ef 100644 --- a/config/optional/facets.facet.type.yml +++ b/config/optional/facets.facet.type.yml @@ -2,10 +2,10 @@ langcode: en status: true dependencies: config: - - search_api.index.content - - views.view.content_search_api + - search_api.index.content + - views.view.content_search_api module: - - search_api + - search_api id: type name: Type url_alias: type diff --git a/config/optional/search_api.index.content.yml b/config/optional/search_api.index.content.yml index 4f007e91e..da8fa4827 100644 --- a/config/optional/search_api.index.content.yml +++ b/config/optional/search_api.index.content.yml @@ -2,15 +2,15 @@ langcode: en status: true dependencies: config: - - field.storage.node.field_channel - - field.storage.node.field_tags - - search_api.server.database + - field.storage.node.field_channel + - field.storage.node.field_tags + - search_api.server.database module: - - media_entity - - user - - node - - taxonomy - - search_api + - media_entity + - user + - node + - taxonomy + - search_api id: content name: Content description: '' @@ -23,7 +23,7 @@ field_settings: type: integer dependencies: config: - - field.storage.node.field_channel + - field.storage.node.field_channel field_tags: label: Tags datasource_id: 'entity:node' @@ -31,7 +31,7 @@ field_settings: type: integer dependencies: config: - - field.storage.node.field_tags + - field.storage.node.field_tags label: label: Label property_path: aggregated_field @@ -40,9 +40,9 @@ field_settings: configuration: type: union fields: - - 'entity:media/name' - - 'entity:node/title' - - 'entity:taxonomy_term/name' + - 'entity:media/name' + - 'entity:node/title' + - 'entity:taxonomy_term/name' media_author: label: 'Publisher ID » User » Name' datasource_id: 'entity:media' @@ -50,9 +50,9 @@ field_settings: type: string dependencies: module: - - media_entity - - user - - user + - media_entity + - user + - user media_changed: label: Changed datasource_id: 'entity:media' @@ -60,7 +60,7 @@ field_settings: type: date dependencies: module: - - media_entity + - media_entity media_status: label: 'Publishing status' datasource_id: 'entity:media' @@ -68,7 +68,7 @@ field_settings: type: boolean dependencies: module: - - media_entity + - media_entity name: label: 'Authored by » User » Name' datasource_id: 'entity:node' @@ -76,9 +76,9 @@ field_settings: type: string dependencies: module: - - node - - user - - user + - node + - user + - user node_changed: label: Changed datasource_id: 'entity:node' @@ -86,7 +86,7 @@ field_settings: type: date dependencies: module: - - node + - node node_grants: label: 'Node access information' property_path: search_api_node_grants @@ -101,7 +101,7 @@ field_settings: type: boolean dependencies: module: - - node + - node rendered_item: label: 'Rendered HTML output' property_path: rendered_item @@ -132,7 +132,7 @@ field_settings: type_locked: true dependencies: module: - - node + - node sticky: label: 'Sticky at top of lists' datasource_id: 'entity:node' @@ -140,7 +140,7 @@ field_settings: type: boolean dependencies: module: - - node + - node term_changed: label: Changed datasource_id: 'entity:taxonomy_term' @@ -148,7 +148,7 @@ field_settings: type: date dependencies: module: - - taxonomy + - taxonomy term_status: label: Published datasource_id: 'entity:taxonomy_term' @@ -156,7 +156,7 @@ field_settings: type: boolean dependencies: module: - - taxonomy + - taxonomy type: label: Type property_path: aggregated_field @@ -164,9 +164,9 @@ field_settings: configuration: type: union fields: - - 'entity:media/bundle' - - 'entity:node/type' - - 'entity:taxonomy_term/vid' + - 'entity:media/bundle' + - 'entity:node/type' + - 'entity:taxonomy_term/vid' uid: label: uid datasource_id: 'entity:node' @@ -176,7 +176,7 @@ field_settings: type_locked: true dependencies: module: - - node + - node datasource_settings: 'entity:media': bundles: @@ -213,11 +213,11 @@ processor_settings: html_filter: all_fields: true fields: - - label - - media_author - - name - - rendered_item - - type + - label + - media_author + - name + - rendered_item + - type title: true alt: true tags: @@ -232,11 +232,11 @@ processor_settings: ignorecase: all_fields: true fields: - - label - - media_author - - name - - rendered_item - - type + - label + - media_author + - name + - rendered_item + - type weights: preprocess_index: -20 preprocess_query: -20 @@ -244,8 +244,8 @@ processor_settings: tokenizer: all_fields: true fields: - - label - - rendered_item + - label + - rendered_item spaces: '' overlap_cjk: 1 minimum_word_size: '3' diff --git a/config/optional/search_api.server.database.yml b/config/optional/search_api.server.database.yml index 4eb90a03d..4aa0f8351 100644 --- a/config/optional/search_api.server.database.yml +++ b/config/optional/search_api.server.database.yml @@ -2,7 +2,7 @@ langcode: en status: true dependencies: module: - - search_api_db + - search_api_db id: database name: Database description: '' diff --git a/config/optional/views.view.content.yml b/config/optional/views.view.content.yml index 7e1baa1bb..1a9b59c75 100644 --- a/config/optional/views.view.content.yml +++ b/config/optional/views.view.content.yml @@ -6,10 +6,14 @@ dependencies: - field.storage.node.field_teaser_media - image.style.thumbnail module: + - config_selector - media_entity - node - user - - config_selector +third_party_settings: + config_selector: + feature: thunder_content_view + priority: 0 id: content label: Content module: node @@ -18,10 +22,6 @@ tag: default base_table: node_field_data base_field: nid core: 8.x -third_party_settings: - config_selector: - feature: thunder_content_view - priority: 0 display: default: display_options: diff --git a/config/optional/views.view.content_search_api.yml b/config/optional/views.view.content_search_api.yml index 16271df12..95fdb04b3 100644 --- a/config/optional/views.view.content_search_api.yml +++ b/config/optional/views.view.content_search_api.yml @@ -2,16 +2,17 @@ langcode: en status: true dependencies: config: - - field.storage.node.field_channel - - field.storage.node.field_teaser_media - - image.style.thumbnail - - search_api.index.content + - field.storage.node.field_channel + - field.storage.node.field_teaser_media + - image.style.thumbnail + - search_api.index.content module: - - config_selector - - media_entity - - search_api - - user - - views_bulk_operations + - config_selector + - media_entity + - search_api + - thunder + - user + - views_bulk_operations third_party_settings: config_selector: feature: thunder_content_view @@ -903,14 +904,14 @@ display: cache_metadata: max-age: 0 contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - user.permissions tags: - - 'config:field.storage.node.field_channel' - - 'config:field.storage.node.field_teaser_media' + - 'config:field.storage.node.field_channel' + - 'config:field.storage.node.field_teaser_media' page_1: display_options: path: admin/content @@ -939,11 +940,11 @@ display: cache_metadata: max-age: 0 contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - user.permissions tags: - - 'config:field.storage.node.field_channel' - - 'config:field.storage.node.field_teaser_media' + - 'config:field.storage.node.field_channel' + - 'config:field.storage.node.field_teaser_media' diff --git a/config/optional/views.view.media_search_api.yml b/config/optional/views.view.media_search_api.yml index a0d7bd4a3..0d66f312c 100644 --- a/config/optional/views.view.media_search_api.yml +++ b/config/optional/views.view.media_search_api.yml @@ -2,16 +2,17 @@ langcode: en status: true dependencies: config: - - field.storage.media.field_expires - - image.style.thumbnail - - search_api.index.content + - field.storage.media.field_expires + - image.style.thumbnail + - search_api.index.content module: - - config_selector - - datetime - - image - - search_api - - user - - views_bulk_operations + - config_selector + - datetime + - image + - search_api + - thunder + - user + - views_bulk_operations third_party_settings: config_selector: feature: thunder_media_view @@ -866,13 +867,13 @@ display: cache_metadata: max-age: 0 contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - user.permissions tags: - - 'config:field.storage.media.field_expires' + - 'config:field.storage.media.field_expires' page_1: display_options: path: admin/content/media @@ -901,10 +902,10 @@ display: cache_metadata: max-age: 0 contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - user.permissions tags: - - 'config:field.storage.media.field_expires' + - 'config:field.storage.media.field_expires' diff --git a/config/optional/views.view.thunder_media.yml b/config/optional/views.view.thunder_media.yml index 7cb13db2d..23427a321 100644 --- a/config/optional/views.view.thunder_media.yml +++ b/config/optional/views.view.thunder_media.yml @@ -5,11 +5,15 @@ dependencies: - field.storage.media.field_expires - image.style.thumbnail module: + - config_selector - datetime - image - media_entity - user - - config_selector +third_party_settings: + config_selector: + feature: thunder_media_view + priority: 0 id: thunder_media label: Media module: views @@ -18,10 +22,6 @@ tag: '' base_table: media_field_data base_field: mid core: 8.x -third_party_settings: - config_selector: - feature: thunder_media_view - priority: 0 display: default: display_plugin: default From 9df45a5041aeb8ccb7955f5d7ec5cfa5648f2b6b Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Mon, 7 Jan 2019 11:56:19 +0100 Subject: [PATCH 102/134] Update patches --- composer.json | 14 ++++++-------- drupal-org-core.make | 3 ++- drupal-org.make | 7 ++----- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index c534301c1..9bc9f8578 100644 --- a/composer.json +++ b/composer.json @@ -72,15 +72,13 @@ "Provide inline entity form FieldWidgetDisplay": "https://www.drupal.org/files/issues/2858438_6.patch" }, "drupal/search_api": { - "Support entity 'operations' in Views": "https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch", - "VBO on a Search API view with facets didn't work": "https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch", - "Facets are lost by Views on keyword search": "https://www.drupal.org/files/issues/2018-11-13/2378945-33-drupal8.patch" + "VBO on a Search API view with facets didn't work": "https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch" }, "drupal/scheduler": { "Scheduler integration with core Content moderation": "https://www.drupal.org/files/issues/2018-12-10/2798689-153.patch" }, - "drupal/views_bulk_operations": { - "Fatal error when executing simple actions on Adminimal theme": "https://www.drupal.org/files/issues/2018-09-19/views_bulk_operations-theme_error-2952498-29.patch" + "drupal/core": { + "Extension objects should not implement \\Serializable": "https://www.drupal.org/files/issues/2018-12-18/2701829-8.6.x-112.patch" }, "drupal/password_policy": { "Policies should declare a config dependency on the plugin modules": "https://www.drupal.org/files/issues/2018-10-09/2918974-2.patch" @@ -102,7 +100,7 @@ "drupal/blazy": "^1.0", "drupal/breakpoint_js_settings": "^1.0", "drupal/checklistapi": "^1.0", - "drupal/core": "^8.6.0", + "drupal/core": "8.6.5", "drupal/config_selector": "^1.0", "drupal/config_update": "^1.0", "drupal/content_lock": "^1.0", @@ -143,7 +141,7 @@ "drupal/redirect": "^1.0", "drupal/riddle_marketplace": "^2.0", "drupal/scheduler": "1.0", - "drupal/search_api": "1.11", + "drupal/search_api": "dev-1.x", "drupal/select2": "^1.0", "drupal/simple_sitemap": "^2.0", "drupal/shariff": "^1.0", @@ -152,7 +150,7 @@ "drupal/thunder_admin": "^1.0 || ^2.0-beta15", "drupal/token": "^1.0", "drupal/video_embed_field": "^1.0", - "drupal/views_bulk_operations": "2.4", + "drupal/views_bulk_operations": "^2.4", "drupal/views_load_more": "dev-1.x", "valiton/harbourmaster": "~8.1", "bower-asset/dropzone": "^5.1", diff --git a/drupal-org-core.make b/drupal-org-core.make index 9bb85ad44..f622a4c3a 100644 --- a/drupal-org-core.make +++ b/drupal-org-core.make @@ -1,4 +1,5 @@ api = 2 core = 8.x projects[drupal][type] = core -projects[drupal][version] = 8.6.3 +projects[drupal][version] = 8.6.5 +projects[drupal][patch][] = https://www.drupal.org/files/issues/2018-12-18/2701829-8.6.x-112.patch diff --git a/drupal-org.make b/drupal-org.make index 5ef02ac76..e52b03955 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -104,10 +104,8 @@ projects[riddle_marketplace][version] = 2 projects[redirect][type] = module projects[redirect][version] = 1 projects[search_api][type] = module -projects[search_api][version] = 1.11 -projects[search_api][patch][] = https://www.drupal.org/files/issues/2861832-6--views_entity_operations.patch +projects[search_api][download][branch] = 8.x-1.x projects[search_api][patch][] = https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch -projects[search_api][patch][] = https://www.drupal.org/files/issues/2018-11-13/2378945-33-drupal8.patch projects[scheduler][type] = module projects[scheduler][version] = 1.0 projects[scheduler][patch][] = https://www.drupal.org/files/issues/2018-12-10/2798689-153.patch @@ -137,8 +135,7 @@ projects[infinite][type] = theme projects[infinite][download][url] = http://git.drupal.org/sandbox/gos77/2677750.git projects[infinite][download][tag] = 8.x-1.0-beta7 projects[views_bulk_operations][type] = module -projects[views_bulk_operations][version] = 2.4 -projects[views_bulk_operations][patch][] = https://www.drupal.org/files/issues/2018-09-19/views_bulk_operations-theme_error-2952498-29.patch +projects[views_bulk_operations][version] = 2 projects[video_embed_field][type] = module projects[video_embed_field][version] = 1 projects[views_load_more][type] = module From e9cd588e7ae0abfa085d3a182e6df73970e89014 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Mon, 7 Jan 2019 17:43:52 +0100 Subject: [PATCH 103/134] Remove unneeded patch --- composer.json | 3 --- drupal-org.make | 1 - 2 files changed, 4 deletions(-) diff --git a/composer.json b/composer.json index 9bc9f8578..6d87c4d36 100644 --- a/composer.json +++ b/composer.json @@ -71,9 +71,6 @@ "drupal/entity_browser": { "Provide inline entity form FieldWidgetDisplay": "https://www.drupal.org/files/issues/2858438_6.patch" }, - "drupal/search_api": { - "VBO on a Search API view with facets didn't work": "https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch" - }, "drupal/scheduler": { "Scheduler integration with core Content moderation": "https://www.drupal.org/files/issues/2018-12-10/2798689-153.patch" }, diff --git a/drupal-org.make b/drupal-org.make index e52b03955..cf2fbaf61 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -105,7 +105,6 @@ projects[redirect][type] = module projects[redirect][version] = 1 projects[search_api][type] = module projects[search_api][download][branch] = 8.x-1.x -projects[search_api][patch][] = https://www.drupal.org/files/issues/2018-11-06/3011743-2.patch projects[scheduler][type] = module projects[scheduler][version] = 1.0 projects[scheduler][patch][] = https://www.drupal.org/files/issues/2018-12-10/2798689-153.patch From bddeb013308fa8dd7f8746ad3c769eb832b093f5 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 17 Jan 2019 12:47:38 +0100 Subject: [PATCH 104/134] Add performance --- composer.json | 3 + config/optional/search_api.index.content.yml | 86 ++++++++----------- .../views.view.content_search_api.yml | 63 +++++++++++--- .../optional/views.view.media_search_api.yml | 79 ++++++++++++----- drupal-org.make | 1 + 5 files changed, 152 insertions(+), 80 deletions(-) diff --git a/composer.json b/composer.json index 0f8389cb5..33b743c59 100644 --- a/composer.json +++ b/composer.json @@ -81,6 +81,9 @@ "drupal/password_policy": { "Policies should declare a config dependency on the plugin modules": "https://www.drupal.org/files/issues/2018-10-09/2918974-2.patch", "Importing configuration on site without password_policy activated": "https://www.drupal.org/files/issues/2018-07-30/password_policy-config_import_field_error-2771129-57.patch" + }, + "drupal/search_api": { + "SearchApiTagCache::getRowId is very expensive": "https://www.drupal.org/files/issues/2019-01-17/3026526.patch" } } }, diff --git a/config/optional/search_api.index.content.yml b/config/optional/search_api.index.content.yml index da8fa4827..021d0b8af 100644 --- a/config/optional/search_api.index.content.yml +++ b/config/optional/search_api.index.content.yml @@ -1,16 +1,15 @@ langcode: en status: true dependencies: - config: - - field.storage.node.field_channel - - field.storage.node.field_tags - - search_api.server.database module: - media_entity - user - node - - taxonomy - search_api + config: + - field.storage.node.field_channel + - field.storage.node.field_tags + - search_api.server.database id: content name: Content description: '' @@ -32,17 +31,6 @@ field_settings: dependencies: config: - field.storage.node.field_tags - label: - label: Label - property_path: aggregated_field - type: text - boost: !!float 8 - configuration: - type: union - fields: - - 'entity:media/name' - - 'entity:node/title' - - 'entity:taxonomy_term/name' media_author: label: 'Publisher ID » User » Name' datasource_id: 'entity:media' @@ -61,6 +49,14 @@ field_settings: dependencies: module: - media_entity + media_name: + label: 'Media name' + datasource_id: 'entity:media' + property_path: name + type: string + dependencies: + module: + - media_entity media_status: label: 'Publishing status' datasource_id: 'entity:media' @@ -69,6 +65,14 @@ field_settings: dependencies: module: - media_entity + media_type: + label: Bundle + datasource_id: 'entity:media' + property_path: bundle + type: string + dependencies: + module: + - media_entity name: label: 'Authored by » User » Name' datasource_id: 'entity:node' @@ -141,32 +145,22 @@ field_settings: dependencies: module: - node - term_changed: - label: Changed - datasource_id: 'entity:taxonomy_term' - property_path: changed - type: date - dependencies: - module: - - taxonomy - term_status: - label: Published - datasource_id: 'entity:taxonomy_term' - property_path: status - type: boolean + title: + label: Title + datasource_id: 'entity:node' + property_path: title + type: string dependencies: module: - - taxonomy + - node type: - label: Type - property_path: aggregated_field + label: 'Content type' + datasource_id: 'entity:node' + property_path: type type: string - configuration: - type: union - fields: - - 'entity:media/bundle' - - 'entity:node/type' - - 'entity:taxonomy_term/vid' + dependencies: + module: + - node uid: label: uid datasource_id: 'entity:node' @@ -192,13 +186,6 @@ datasource_settings: languages: default: true selected: { } - 'entity:taxonomy_term': - bundles: - default: true - selected: { } - languages: - default: true - selected: { } processor_settings: add_url: { } aggregated_field: { } @@ -213,10 +200,12 @@ processor_settings: html_filter: all_fields: true fields: - - label - media_author + - media_name + - media_type - name - rendered_item + - title - type title: true alt: true @@ -232,10 +221,12 @@ processor_settings: ignorecase: all_fields: true fields: - - label - media_author + - media_name + - media_type - name - rendered_item + - title - type weights: preprocess_index: -20 @@ -244,7 +235,6 @@ processor_settings: tokenizer: all_fields: true fields: - - label - rendered_item spaces: '' overlap_cjk: 1 diff --git a/config/optional/views.view.content_search_api.yml b/config/optional/views.view.content_search_api.yml index 95fdb04b3..46039690e 100644 --- a/config/optional/views.view.content_search_api.yml +++ b/config/optional/views.view.content_search_api.yml @@ -90,7 +90,7 @@ display: columns: views_bulk_operations_bulk_form: views_bulk_operations_bulk_form field_teaser_media: field_teaser_media - label: label + title: title type: type field_channel: field_channel status: status @@ -107,7 +107,7 @@ display: separator: '' empty_column: false responsive: priority-low - label: + title: sortable: true default_sort_order: asc align: '' @@ -332,10 +332,10 @@ display: view_mode: default entity_type: node plugin_id: search_api_field - label: - id: label + title: + id: title table: search_api_index_content - field: label + field: title relationship: none group_type: group admin_label: '' @@ -372,7 +372,7 @@ display: element_class: '' element_label_type: '' element_label_class: '' - element_label_colon: false + element_label_colon: true element_wrapper_type: '' element_wrapper_class: '' element_default_classes: true @@ -380,10 +380,28 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - link_to_item: true + click_sort_column: value + type: string + settings: + link_to_entity: true + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false multi_type: separator - multi_separator: ', ' - plugin_id: search_api + separator: ', ' + field_api_classes: false + field_rendering: true + fallback_handler: search_api + fallback_options: + link_to_item: false + use_highlighting: false + multi_type: separator + multi_separator: ', ' + plugin_id: search_api_field type: id: type table: search_api_index_content @@ -432,10 +450,31 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - link_to_item: false + click_sort_column: target_id + type: entity_reference_label + settings: + link: false + group_column: target_id + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false multi_type: separator - multi_separator: ', ' - plugin_id: search_api + separator: ', ' + field_api_classes: false + field_rendering: true + fallback_handler: search_api_entity + fallback_options: + link_to_item: false + use_highlighting: false + multi_type: separator + multi_separator: ', ' + display_methods: + node_type: + display_method: label + plugin_id: search_api_field field_channel: id: field_channel table: search_api_index_content diff --git a/config/optional/views.view.media_search_api.yml b/config/optional/views.view.media_search_api.yml index 0d66f312c..1b216273a 100644 --- a/config/optional/views.view.media_search_api.yml +++ b/config/optional/views.view.media_search_api.yml @@ -90,8 +90,8 @@ display: columns: views_bulk_operations_bulk_form: views_bulk_operations_bulk_form thumbnail: thumbnail - label: label - type: type + media_name: media_name + media_type: media_type media_status: media_status field_expires: field_expires media_changed: media_changed @@ -107,20 +107,20 @@ display: separator: '' empty_column: false responsive: '' - label: + media_name: sortable: true default_sort_order: asc align: '' separator: '' empty_column: false - responsive: priority-medium - type: + responsive: '' + media_type: sortable: true default_sort_order: asc align: '' separator: '' empty_column: false - responsive: priority-medium + responsive: '' media_status: sortable: true default_sort_order: asc @@ -300,14 +300,14 @@ display: multi_separator: ', ' entity_type: media plugin_id: search_api_field - label: - id: label + media_name: + id: media_name table: search_api_index_content - field: label + field: media_name relationship: none group_type: group admin_label: '' - label: Title + label: Name exclude: false alter: alter_text: false @@ -340,7 +340,7 @@ display: element_class: '' element_label_type: '' element_label_class: '' - element_label_colon: false + element_label_colon: true element_wrapper_type: '' element_wrapper_class: '' element_default_classes: true @@ -348,14 +348,32 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - link_to_item: true + click_sort_column: value + type: string + settings: + link_to_entity: true + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false multi_type: separator - multi_separator: ', ' - plugin_id: search_api - type: - id: type + separator: ', ' + field_api_classes: false + field_rendering: true + fallback_handler: search_api + fallback_options: + link_to_item: true + use_highlighting: false + multi_type: separator + multi_separator: ', ' + plugin_id: search_api_field + media_type: + id: media_type table: search_api_index_content - field: type + field: media_type relationship: none group_type: group admin_label: '' @@ -400,10 +418,31 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - link_to_item: false + click_sort_column: target_id + type: entity_reference_label + settings: + link: true + group_column: target_id + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false multi_type: separator - multi_separator: ', ' - plugin_id: search_api + separator: ', ' + field_api_classes: false + field_rendering: true + fallback_handler: search_api_entity + fallback_options: + link_to_item: false + use_highlighting: false + multi_type: separator + multi_separator: ', ' + display_methods: + media_bundle: + display_method: label + plugin_id: search_api_field media_status: id: media_status table: search_api_index_content diff --git a/drupal-org.make b/drupal-org.make index 6fb54f35b..a936a0735 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -106,6 +106,7 @@ projects[redirect][type] = module projects[redirect][version] = 1 projects[search_api][type] = module projects[search_api][download][branch] = 8.x-1.x +projects[search_api][patch][] = https://www.drupal.org/files/issues/2019-01-17/3026526.patch projects[scheduler][type] = module projects[scheduler][version] = 1.0 projects[scheduler][patch][] = https://www.drupal.org/files/issues/2019-01-09/2798689-160-alternative-approach.patch From 84061fe19d2ff9ea567a956b5db178cdb674b498 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 17 Jan 2019 16:57:30 +0100 Subject: [PATCH 105/134] Add search_api view displays --- ...view_display.node.article.search_index.yml | 54 +++++++++++++++++++ ...ty_view_display.node.page.search_index.yml | 28 ++++++++++ config/optional/search_api.index.content.yml | 8 ++- 3 files changed, 85 insertions(+), 5 deletions(-) create mode 100644 config/install/core.entity_view_display.node.article.search_index.yml create mode 100644 config/install/core.entity_view_display.node.page.search_index.yml diff --git a/config/install/core.entity_view_display.node.article.search_index.yml b/config/install/core.entity_view_display.node.article.search_index.yml new file mode 100644 index 000000000..2ddcba92e --- /dev/null +++ b/config/install/core.entity_view_display.node.article.search_index.yml @@ -0,0 +1,54 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.search_index + - field.field.node.article.field_channel + - field.field.node.article.field_meta_tags + - field.field.node.article.field_paragraphs + - field.field.node.article.field_seo_title + - field.field.node.article.field_tags + - field.field.node.article.field_teaser_media + - field.field.node.article.field_teaser_text + - node.type.article + module: + - entity_reference_revisions + - user +id: node.article.search_index +targetEntityType: node +bundle: article +mode: search_index +content: + field_paragraphs: + type: entity_reference_revisions_entity_view + weight: 0 + label: hidden + settings: + view_mode: default + link: '' + third_party_settings: { } + region: content + field_tags: + type: entity_reference_label + weight: 2 + label: hidden + settings: + link: true + third_party_settings: { } + region: content + field_teaser_text: + type: basic_string + weight: 1 + region: content + label: hidden + settings: { } + third_party_settings: { } +hidden: + content_moderation_control: true + field_channel: true + field_meta_tags: true + field_seo_title: true + field_teaser_media: true + langcode: true + links: true + shariff_field: true diff --git a/config/install/core.entity_view_display.node.page.search_index.yml b/config/install/core.entity_view_display.node.page.search_index.yml new file mode 100644 index 000000000..21b553626 --- /dev/null +++ b/config/install/core.entity_view_display.node.page.search_index.yml @@ -0,0 +1,28 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.search_index + - field.field.node.page.body + - node.type.page + module: + - text + - user +id: node.page.search_index +targetEntityType: node +bundle: page +mode: search_index +content: + body: + label: hidden + type: text_default + weight: 100 + settings: { } + third_party_settings: { } + region: content + links: + weight: 101 + region: content +hidden: + langcode: true + shariff_field: true diff --git a/config/optional/search_api.index.content.yml b/config/optional/search_api.index.content.yml index 021d0b8af..e2e30c542 100644 --- a/config/optional/search_api.index.content.yml +++ b/config/optional/search_api.index.content.yml @@ -10,6 +10,7 @@ dependencies: - field.storage.node.field_channel - field.storage.node.field_tags - search_api.server.database + - core.entity_view_mode.node.search_index id: content name: Content description: '' @@ -122,11 +123,8 @@ field_settings: twitter: default video: default 'entity:node': - article: default - page: default - 'entity:taxonomy_term': - channel: default - tags: default + article: search_index + page: search_index status: label: status datasource_id: 'entity:node' From 18f272e8ef92cd2d792bdaa11a9ffa19a69e3e7d Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Fri, 18 Jan 2019 10:18:09 +0100 Subject: [PATCH 106/134] Fix tests --- .../core.entity_view_display.node.article.search_index.yml | 0 .../core.entity_view_display.node.page.search_index.yml | 0 .../src/FunctionalJavascript/Integration/ConfigSelectorTest.php | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) rename config/{install => optional}/core.entity_view_display.node.article.search_index.yml (100%) rename config/{install => optional}/core.entity_view_display.node.page.search_index.yml (100%) diff --git a/config/install/core.entity_view_display.node.article.search_index.yml b/config/optional/core.entity_view_display.node.article.search_index.yml similarity index 100% rename from config/install/core.entity_view_display.node.article.search_index.yml rename to config/optional/core.entity_view_display.node.article.search_index.yml diff --git a/config/install/core.entity_view_display.node.page.search_index.yml b/config/optional/core.entity_view_display.node.page.search_index.yml similarity index 100% rename from config/install/core.entity_view_display.node.page.search_index.yml rename to config/optional/core.entity_view_display.node.page.search_index.yml diff --git a/tests/src/FunctionalJavascript/Integration/ConfigSelectorTest.php b/tests/src/FunctionalJavascript/Integration/ConfigSelectorTest.php index 98a97437e..fd9ed9655 100644 --- a/tests/src/FunctionalJavascript/Integration/ConfigSelectorTest.php +++ b/tests/src/FunctionalJavascript/Integration/ConfigSelectorTest.php @@ -37,7 +37,7 @@ public function testContentViewSearchApi() { $assert_session->waitForId('edit-index-now'); $this->drupalGet('admin/content'); - $assert_session->elementExists('xpath', '//*[@id="view-label-table-column"]/a'); + $assert_session->elementExists('xpath', '//*[@id="view-title-table-column"]/a'); $assert_session->elementExists('css', '#block-thunder-admin-content > div > div.view-content-search-api'); // Uninstall search_api. From a2c30d12b2ddc22779516d3673c00c6d91ba5aaf Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 22 Jan 2019 15:25:01 +0100 Subject: [PATCH 107/134] Back to current core version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 33b743c59..6b05fe859 100644 --- a/composer.json +++ b/composer.json @@ -102,7 +102,7 @@ "drupal/blazy": "^1.0", "drupal/breakpoint_js_settings": "^1.0", "drupal/checklistapi": "^1.0", - "drupal/core": "8.6.5", + "drupal/core": "^8.6.0", "drupal/config_selector": "^1.0", "drupal/config_update": "^1.0", "drupal/content_lock": "^1.0", From fccc0759f79b3798180e826117852dd28af2d700 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 29 Jan 2019 11:49:12 +0100 Subject: [PATCH 108/134] Add facet item limits --- config/optional/facets.facet.author.yml | 2 +- config/optional/facets.facet.channel.yml | 2 +- .../optional/facets.facet.promoted_to_front_page.yml | 2 +- config/optional/facets.facet.status.yml | 2 +- .../optional/facets.facet.sticky_at_top_of_lists.yml | 2 +- config/optional/facets.facet.tags.yml | 4 ++-- config/optional/facets.facet.type.yml | 2 +- config/optional/search_api.index.content.yml | 10 +++++----- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/config/optional/facets.facet.author.yml b/config/optional/facets.facet.author.yml index e0640fc0d..1cab7abc1 100644 --- a/config/optional/facets.facet.author.yml +++ b/config/optional/facets.facet.author.yml @@ -25,7 +25,7 @@ query_operator: or use_hierarchy: false expand_hierarchy: false enable_parent_when_child_gets_disabled: true -hard_limit: 10 +hard_limit: 20 exclude: false only_visible_when_facet_source_is_visible: true processor_configs: diff --git a/config/optional/facets.facet.channel.yml b/config/optional/facets.facet.channel.yml index 77ebb6407..5695f9e64 100644 --- a/config/optional/facets.facet.channel.yml +++ b/config/optional/facets.facet.channel.yml @@ -25,7 +25,7 @@ query_operator: and use_hierarchy: true expand_hierarchy: true enable_parent_when_child_gets_disabled: true -hard_limit: 0 +hard_limit: 250 exclude: false only_visible_when_facet_source_is_visible: true processor_configs: diff --git a/config/optional/facets.facet.promoted_to_front_page.yml b/config/optional/facets.facet.promoted_to_front_page.yml index dd0b7f5d4..ee4e47731 100644 --- a/config/optional/facets.facet.promoted_to_front_page.yml +++ b/config/optional/facets.facet.promoted_to_front_page.yml @@ -25,7 +25,7 @@ query_operator: or use_hierarchy: false expand_hierarchy: false enable_parent_when_child_gets_disabled: true -hard_limit: 0 +hard_limit: 3 exclude: false only_visible_when_facet_source_is_visible: true processor_configs: diff --git a/config/optional/facets.facet.status.yml b/config/optional/facets.facet.status.yml index f7c829232..80bd74dcd 100644 --- a/config/optional/facets.facet.status.yml +++ b/config/optional/facets.facet.status.yml @@ -25,7 +25,7 @@ query_operator: or use_hierarchy: false expand_hierarchy: false enable_parent_when_child_gets_disabled: true -hard_limit: 0 +hard_limit: 3 exclude: false only_visible_when_facet_source_is_visible: true processor_configs: diff --git a/config/optional/facets.facet.sticky_at_top_of_lists.yml b/config/optional/facets.facet.sticky_at_top_of_lists.yml index d35c70c0e..3010db689 100644 --- a/config/optional/facets.facet.sticky_at_top_of_lists.yml +++ b/config/optional/facets.facet.sticky_at_top_of_lists.yml @@ -25,7 +25,7 @@ query_operator: or use_hierarchy: false expand_hierarchy: false enable_parent_when_child_gets_disabled: true -hard_limit: 0 +hard_limit: 3 exclude: false only_visible_when_facet_source_is_visible: true processor_configs: diff --git a/config/optional/facets.facet.tags.yml b/config/optional/facets.facet.tags.yml index d515f7715..1abc37dca 100644 --- a/config/optional/facets.facet.tags.yml +++ b/config/optional/facets.facet.tags.yml @@ -22,10 +22,10 @@ widget: autocomplete: true match_operator: CONTAINS query_operator: and -use_hierarchy: true +use_hierarchy: false expand_hierarchy: true enable_parent_when_child_gets_disabled: true -hard_limit: 0 +hard_limit: 50 exclude: false only_visible_when_facet_source_is_visible: true processor_configs: diff --git a/config/optional/facets.facet.type.yml b/config/optional/facets.facet.type.yml index 7bad366ef..1c488deee 100644 --- a/config/optional/facets.facet.type.yml +++ b/config/optional/facets.facet.type.yml @@ -25,7 +25,7 @@ query_operator: or use_hierarchy: false expand_hierarchy: false enable_parent_when_child_gets_disabled: true -hard_limit: 0 +hard_limit: 50 exclude: false only_visible_when_facet_source_is_visible: true processor_configs: diff --git a/config/optional/search_api.index.content.yml b/config/optional/search_api.index.content.yml index e2e30c542..cfd7921b1 100644 --- a/config/optional/search_api.index.content.yml +++ b/config/optional/search_api.index.content.yml @@ -1,16 +1,16 @@ langcode: en status: true dependencies: - module: - - media_entity - - user - - node - - search_api config: - field.storage.node.field_channel - field.storage.node.field_tags - search_api.server.database - core.entity_view_mode.node.search_index + module: + - media_entity + - user + - node + - search_api id: content name: Content description: '' From 91e4757c5c519f3e09c530b02b84c941c4c2ae7b Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 31 Jan 2019 10:12:49 +0100 Subject: [PATCH 109/134] Add facets patxh --- composer.json | 3 +++ .../facets.facet.promoted_to_front_page.yml | 18 ------------------ config/optional/facets.facet.status.yml | 18 ------------------ .../facets.facet.sticky_at_top_of_lists.yml | 18 ------------------ 4 files changed, 3 insertions(+), 54 deletions(-) diff --git a/composer.json b/composer.json index e52856b94..3d360e402 100644 --- a/composer.json +++ b/composer.json @@ -83,6 +83,9 @@ }, "drupal/search_api": { "SearchApiTagCache::getRowId is very expensive": "https://www.drupal.org/files/issues/2019-01-17/3026526.patch" + }, + "drupal/facets": { + "Improve performance for taxonomy hierarchical facets": "https://www.drupal.org/files/issues/2019-01-30/3005018-8.patch" } } }, diff --git a/config/optional/facets.facet.promoted_to_front_page.yml b/config/optional/facets.facet.promoted_to_front_page.yml index ee4e47731..423b6c258 100644 --- a/config/optional/facets.facet.promoted_to_front_page.yml +++ b/config/optional/facets.facet.promoted_to_front_page.yml @@ -29,12 +29,6 @@ hard_limit: 3 exclude: false only_visible_when_facet_source_is_visible: true processor_configs: - active_widget_order: - processor_id: active_widget_order - weights: - sort: -10 - settings: - sort: DESC boolean_item: processor_id: boolean_item weights: @@ -42,18 +36,6 @@ processor_configs: settings: on_value: 'Yes' off_value: 'No' - count_widget_order: - processor_id: count_widget_order - weights: - sort: -10 - settings: - sort: DESC - display_value_widget_order: - processor_id: display_value_widget_order - weights: - sort: -10 - settings: - sort: ASC hide_1_result_facet: processor_id: hide_1_result_facet weights: diff --git a/config/optional/facets.facet.status.yml b/config/optional/facets.facet.status.yml index 80bd74dcd..18a63623f 100644 --- a/config/optional/facets.facet.status.yml +++ b/config/optional/facets.facet.status.yml @@ -29,12 +29,6 @@ hard_limit: 3 exclude: false only_visible_when_facet_source_is_visible: true processor_configs: - active_widget_order: - processor_id: active_widget_order - weights: - sort: -10 - settings: - sort: DESC boolean_item: processor_id: boolean_item weights: @@ -42,18 +36,6 @@ processor_configs: settings: on_value: Published off_value: Unpublished - count_widget_order: - processor_id: count_widget_order - weights: - sort: -10 - settings: - sort: DESC - display_value_widget_order: - processor_id: display_value_widget_order - weights: - sort: -10 - settings: - sort: ASC hide_1_result_facet: processor_id: hide_1_result_facet weights: diff --git a/config/optional/facets.facet.sticky_at_top_of_lists.yml b/config/optional/facets.facet.sticky_at_top_of_lists.yml index 3010db689..7b69f3205 100644 --- a/config/optional/facets.facet.sticky_at_top_of_lists.yml +++ b/config/optional/facets.facet.sticky_at_top_of_lists.yml @@ -29,12 +29,6 @@ hard_limit: 3 exclude: false only_visible_when_facet_source_is_visible: true processor_configs: - active_widget_order: - processor_id: active_widget_order - weights: - sort: -10 - settings: - sort: DESC boolean_item: processor_id: boolean_item weights: @@ -42,18 +36,6 @@ processor_configs: settings: on_value: 'Yes' off_value: 'No' - count_widget_order: - processor_id: count_widget_order - weights: - sort: -10 - settings: - sort: DESC - display_value_widget_order: - processor_id: display_value_widget_order - weights: - sort: -10 - settings: - sort: ASC hide_1_result_facet: processor_id: hide_1_result_facet weights: From e3744888c695b69e823692ff50aa3237f66108ef Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 6 Feb 2019 15:33:53 +0100 Subject: [PATCH 110/134] Remove media view --- ...ig_selector.feature.thunder_media_view.yml | 9 - config/optional/facets.facet.media_status.yml | 75 -- config/optional/facets.facet.media_type.yml | 68 -- ...__views_page__media_search_api__page_1.yml | 11 - config/optional/search_api.index.content.yml | 58 +- .../optional/views.view.media_search_api.yml | 950 ------------------ config/optional/views.view.thunder_media.yml | 5 - ...thunder_add_config_selector_to_content.yml | 8 + ...r_add_config_selector_to_content_media.yml | 16 - .../thunder_riddle/thunder_riddle.module | 10 +- modules/thunder_media/thunder_media.module | 20 +- modules/thunder_updater/updates.yml | 2 +- .../Functional/InstalledConfigurationTest.php | 3 - thunder.post_update.php | 14 +- 14 files changed, 24 insertions(+), 1225 deletions(-) delete mode 100644 config/install/config_selector.feature.thunder_media_view.yml delete mode 100644 config/optional/facets.facet.media_status.yml delete mode 100644 config/optional/facets.facet.media_type.yml delete mode 100644 config/optional/facets.facet_source.search_api__views_page__media_search_api__page_1.yml delete mode 100644 config/optional/views.view.media_search_api.yml create mode 100644 config/update/thunder_add_config_selector_to_content.yml delete mode 100644 config/update/thunder_add_config_selector_to_content_media.yml diff --git a/config/install/config_selector.feature.thunder_media_view.yml b/config/install/config_selector.feature.thunder_media_view.yml deleted file mode 100644 index b66948d64..000000000 --- a/config/install/config_selector.feature.thunder_media_view.yml +++ /dev/null @@ -1,9 +0,0 @@ -langcode: en -status: true -dependencies: - enforced: - module: - - config_selector -id: thunder_media_view -label: 'Media view' -description: 'The main view for editing media items' diff --git a/config/optional/facets.facet.media_status.yml b/config/optional/facets.facet.media_status.yml deleted file mode 100644 index c0cbce09b..000000000 --- a/config/optional/facets.facet.media_status.yml +++ /dev/null @@ -1,75 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - search_api.index.content - - views.view.media_search_api - module: - - search_api -id: media_status -name: Status -url_alias: media_status -weight: -1 -min_count: 1 -show_only_one_result: true -field_identifier: media_status -facet_source_id: 'search_api:views_page__media_search_api__page_1' -widget: - type: select2 - config: - show_numbers: true - width: resolve - autocomplete: false - match_operator: CONTAINS -query_operator: or -use_hierarchy: false -expand_hierarchy: false -enable_parent_when_child_gets_disabled: true -hard_limit: 0 -exclude: false -only_visible_when_facet_source_is_visible: true -processor_configs: - active_widget_order: - processor_id: active_widget_order - weights: - sort: -10 - settings: - sort: DESC - boolean_item: - processor_id: boolean_item - weights: - build: -10 - settings: - on_value: Published - off_value: Unpublished - count_widget_order: - processor_id: count_widget_order - weights: - sort: -10 - settings: - sort: DESC - display_value_widget_order: - processor_id: display_value_widget_order - weights: - sort: -10 - settings: - sort: ASC - hide_1_result_facet: - processor_id: hide_1_result_facet - weights: - build: 50 - settings: { } - hide_non_narrowing_result_processor: - processor_id: hide_non_narrowing_result_processor - weights: - build: -10 - settings: { } - url_processor_handler: - processor_id: url_processor_handler - weights: - pre_query: -10 - build: -10 - settings: { } -empty_behavior: - behavior: none -show_title: true diff --git a/config/optional/facets.facet.media_type.yml b/config/optional/facets.facet.media_type.yml deleted file mode 100644 index 6607c1419..000000000 --- a/config/optional/facets.facet.media_type.yml +++ /dev/null @@ -1,68 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - search_api.index.content - - views.view.media_search_api - module: - - search_api -id: media_type -name: Type -url_alias: media_type -weight: -2 -min_count: 1 -show_only_one_result: true -field_identifier: type -facet_source_id: 'search_api:views_page__media_search_api__page_1' -widget: - type: select2 - config: - show_numbers: true - width: resolve - autocomplete: false - match_operator: CONTAINS -query_operator: or -use_hierarchy: false -expand_hierarchy: false -enable_parent_when_child_gets_disabled: true -hard_limit: 0 -exclude: false -only_visible_when_facet_source_is_visible: true -processor_configs: - active_widget_order: - processor_id: active_widget_order - weights: - sort: -10 - settings: - sort: DESC - count_widget_order: - processor_id: count_widget_order - weights: - sort: -10 - settings: - sort: DESC - display_value_widget_order: - processor_id: display_value_widget_order - weights: - sort: -10 - settings: - sort: ASC - hide_1_result_facet: - processor_id: hide_1_result_facet - weights: - build: -10 - settings: { } - hide_non_narrowing_result_processor: - processor_id: hide_non_narrowing_result_processor - weights: - build: -10 - settings: { } - url_processor_handler: - processor_id: url_processor_handler - weights: - pre_query: -10 - build: -10 - settings: { } -empty_behavior: - behavior: none -show_title: true diff --git a/config/optional/facets.facet_source.search_api__views_page__media_search_api__page_1.yml b/config/optional/facets.facet_source.search_api__views_page__media_search_api__page_1.yml deleted file mode 100644 index 5198961ce..000000000 --- a/config/optional/facets.facet_source.search_api__views_page__media_search_api__page_1.yml +++ /dev/null @@ -1,11 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: search_api__views_page__media_search_api__page_1 -name: 'search_api:views_page__media_search_api__page_1' -filter_key: '' -url_processor: query_string -breadcrumb: - active: false - before: true - group: false diff --git a/config/optional/search_api.index.content.yml b/config/optional/search_api.index.content.yml index cfd7921b1..30fd6232d 100644 --- a/config/optional/search_api.index.content.yml +++ b/config/optional/search_api.index.content.yml @@ -7,9 +7,8 @@ dependencies: - search_api.server.database - core.entity_view_mode.node.search_index module: - - media_entity - - user - node + - user - search_api id: content name: Content @@ -32,48 +31,6 @@ field_settings: dependencies: config: - field.storage.node.field_tags - media_author: - label: 'Publisher ID » User » Name' - datasource_id: 'entity:media' - property_path: 'uid:entity:name' - type: string - dependencies: - module: - - media_entity - - user - - user - media_changed: - label: Changed - datasource_id: 'entity:media' - property_path: changed - type: date - dependencies: - module: - - media_entity - media_name: - label: 'Media name' - datasource_id: 'entity:media' - property_path: name - type: string - dependencies: - module: - - media_entity - media_status: - label: 'Publishing status' - datasource_id: 'entity:media' - property_path: status - type: boolean - dependencies: - module: - - media_entity - media_type: - label: Bundle - datasource_id: 'entity:media' - property_path: bundle - type: string - dependencies: - module: - - media_entity name: label: 'Authored by » User » Name' datasource_id: 'entity:node' @@ -170,13 +127,6 @@ field_settings: module: - node datasource_settings: - 'entity:media': - bundles: - default: true - selected: { } - languages: - default: true - selected: { } 'entity:node': bundles: default: true @@ -198,9 +148,6 @@ processor_settings: html_filter: all_fields: true fields: - - media_author - - media_name - - media_type - name - rendered_item - title @@ -219,9 +166,6 @@ processor_settings: ignorecase: all_fields: true fields: - - media_author - - media_name - - media_type - name - rendered_item - title diff --git a/config/optional/views.view.media_search_api.yml b/config/optional/views.view.media_search_api.yml deleted file mode 100644 index 1b216273a..000000000 --- a/config/optional/views.view.media_search_api.yml +++ /dev/null @@ -1,950 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.media.field_expires - - image.style.thumbnail - - search_api.index.content - module: - - config_selector - - datetime - - image - - search_api - - thunder - - user - - views_bulk_operations -third_party_settings: - config_selector: - feature: thunder_media_view - priority: 1 -id: media_search_api -label: 'Media - Search API' -module: views -description: 'Find and manage media with an advanced search technology.' -tag: '' -base_table: search_api_index_content -base_field: search_api_id -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content overview' - cache: - type: search_api_tag - options: { } - query: - type: search_api_query - options: - skip_access: false - bypass_access: false - preserve_facet_query_args: true - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: full - options: - items_per_page: 50 - offset: 0 - id: 0 - total_pages: null - tags: - previous: ‹‹ - next: ›› - first: '« First' - last: 'Last »' - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - quantity: 9 - style: - type: table - options: - grouping: { } - row_class: '' - default_row_class: true - override: true - sticky: false - caption: '' - summary: '' - description: '' - columns: - views_bulk_operations_bulk_form: views_bulk_operations_bulk_form - thumbnail: thumbnail - media_name: media_name - media_type: media_type - media_status: media_status - field_expires: field_expires - media_changed: media_changed - search_api_operations: search_api_operations - info: - views_bulk_operations_bulk_form: - align: '' - separator: '' - empty_column: false - responsive: '' - thumbnail: - align: '' - separator: '' - empty_column: false - responsive: '' - media_name: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - media_type: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - media_status: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: priority-medium - field_expires: - align: '' - separator: '' - empty_column: false - responsive: priority-low - media_changed: - sortable: true - default_sort_order: desc - align: '' - separator: '' - empty_column: false - responsive: priority-low - search_api_operations: - align: '' - separator: '' - empty_column: false - responsive: '' - default: '-1' - empty_table: false - row: - type: fields - fields: - views_bulk_operations_bulk_form: - id: views_bulk_operations_bulk_form - table: views - field: views_bulk_operations_bulk_form - relationship: none - group_type: group - admin_label: '' - label: 'Views bulk operations' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - batch: true - batch_size: 10 - form_step: true - buttons: false - action_title: Action - selected_actions: - media_delete_action: media_delete_action - media_publish_action: media_publish_action - media_save_action: media_save_action - media_unpublish_action: media_unpublish_action - node_assign_owner_action: 0 - node_unpromote_action: 0 - node_promote_action: 0 - node_publish_action: 0 - node_save_action: 0 - node_make_sticky_action: 0 - node_unpublish_by_keyword_action: 0 - node_unpublish_action: 0 - node_make_unsticky_action: 0 - views_bulk_operations_delete_entity: 0 - pathauto_update_alias: 0 - preconfiguration: - media_delete_action: - label_override: '' - media_publish_action: - label_override: '' - media_save_action: - label_override: '' - media_unpublish_action: - label_override: '' - plugin_id: views_bulk_operations_bulk_form - thumbnail: - id: thumbnail - table: search_api_datasource_content_entity_media - field: thumbnail - relationship: none - group_type: group - admin_label: '' - label: Thumbnail - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: image - settings: - image_style: thumbnail - image_link: '' - group_column: '' - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - field_rendering: true - fallback_handler: search_api - fallback_options: - link_to_item: false - multi_type: separator - multi_separator: ', ' - entity_type: media - plugin_id: search_api_field - media_name: - id: media_name - table: search_api_index_content - field: media_name - relationship: none - group_type: group - admin_label: '' - label: Name - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: string - settings: - link_to_entity: true - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - field_rendering: true - fallback_handler: search_api - fallback_options: - link_to_item: true - use_highlighting: false - multi_type: separator - multi_separator: ', ' - plugin_id: search_api_field - media_type: - id: media_type - table: search_api_index_content - field: media_type - relationship: none - group_type: group - admin_label: '' - label: Type - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: true - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - field_rendering: true - fallback_handler: search_api_entity - fallback_options: - link_to_item: false - use_highlighting: false - multi_type: separator - multi_separator: ', ' - display_methods: - media_bundle: - display_method: label - plugin_id: search_api_field - media_status: - id: media_status - table: search_api_index_content - field: media_status - relationship: none - group_type: group - admin_label: '' - label: Status - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: boolean - settings: - format: custom - format_custom_true: Published - format_custom_false: Unpublished - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - field_rendering: true - fallback_handler: search_api_boolean - fallback_options: - type: yes-no - type_custom_true: '' - type_custom_false: '' - not: false - link_to_item: false - multi_type: separator - multi_separator: ', ' - plugin_id: search_api_field - field_expires: - id: field_expires - table: search_api_datasource_content_entity_media - field: field_expires - relationship: none - group_type: group - admin_label: '' - label: Expires - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: datetime_default - settings: - timezone_override: '' - format_type: short - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - field_rendering: true - fallback_handler: search_api - fallback_options: - link_to_item: false - multi_type: separator - multi_separator: ', ' - entity_type: media - plugin_id: search_api_field - media_changed: - id: media_changed - table: search_api_index_content - field: media_changed - relationship: none - group_type: group - admin_label: '' - label: Updated - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: timestamp - settings: - date_format: short - custom_date_format: '' - timezone: '' - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - field_rendering: true - fallback_handler: search_api_date - fallback_options: - date_format: fallback - custom_date_format: '' - timezone: '' - link_to_item: false - multi_type: separator - multi_separator: ', ' - plugin_id: search_api_field - search_api_operations: - id: search_api_operations - table: search_api_index_content - field: search_api_operations - relationship: none - group_type: group - admin_label: '' - label: Operations - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - destination: true - plugin_id: search_api_entity_operations - filters: - search_api_fulltext: - id: search_api_fulltext - table: search_api_index_content - field: search_api_fulltext - relationship: none - group_type: group - admin_label: '' - operator: and - value: '' - group: 1 - exposed: true - expose: - operator_id: search_api_fulltext_op - label: 'Fulltext search' - description: '' - use_operator: false - operator: search_api_fulltext_op - identifier: search_api_fulltext - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - editor: '0' - seo: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - parse_mode: terms - min_length: 3 - fields: { } - plugin_id: search_api_fulltext - search_api_language: - id: search_api_language - table: search_api_index_content - field: search_api_language - relationship: none - group_type: group - admin_label: '' - operator: in - value: - '***LANGUAGE_language_interface***': '***LANGUAGE_language_interface***' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: search_api_language - search_api_datasource: - id: search_api_datasource - table: search_api_index_content - field: search_api_datasource - relationship: none - group_type: group - admin_label: '' - operator: or - value: - 'entity:media': 'entity:media' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - reduce_duplicates: false - plugin_id: search_api_datasource - sorts: - search_api_relevance: - id: search_api_relevance - table: search_api_index_content - field: search_api_relevance - relationship: none - group_type: group - admin_label: '' - order: DESC - exposed: false - expose: - label: '' - plugin_id: search_api - media_changed: - id: media_changed - table: search_api_index_content - field: media_changed - relationship: none - group_type: group - admin_label: '' - order: DESC - exposed: false - expose: - label: '' - plugin_id: search_api - search_api_id: - id: search_api_id - table: search_api_index_content - field: search_api_id - relationship: none - group_type: group - admin_label: '' - order: DESC - exposed: false - expose: - label: '' - plugin_id: search_api - title: Media - header: - result: - id: result - table: views - field: result - relationship: none - group_type: group - admin_label: '' - empty: false - content: 'Displaying @start - @end of @total' - plugin_id: result - facet_block: - id: facet_block - table: views - field: facet_block - relationship: none - group_type: group - admin_label: '' - empty: false - plugin_id: facet_block - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - use_ajax: false - filter_groups: - operator: AND - groups: - 1: AND - css_class: thunder-search-api - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - tags: - - 'config:field.storage.media.field_expires' - page_1: - display_options: - path: admin/content/media - menu: - type: tab - title: Media - description: '' - expanded: false - parent: '' - weight: 1 - context: '0' - menu_name: admin - tab_options: - type: normal - title: Content - description: 'Find and manage content' - weight: -10 - display_extenders: { } - defaults: - cache: true - exposed_block: true - display_plugin: page - display_title: Page - id: page_1 - position: 1 - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - tags: - - 'config:field.storage.media.field_expires' diff --git a/config/optional/views.view.thunder_media.yml b/config/optional/views.view.thunder_media.yml index 23427a321..6e780b27a 100644 --- a/config/optional/views.view.thunder_media.yml +++ b/config/optional/views.view.thunder_media.yml @@ -5,15 +5,10 @@ dependencies: - field.storage.media.field_expires - image.style.thumbnail module: - - config_selector - datetime - image - media_entity - user -third_party_settings: - config_selector: - feature: thunder_media_view - priority: 0 id: thunder_media label: Media module: views diff --git a/config/update/thunder_add_config_selector_to_content.yml b/config/update/thunder_add_config_selector_to_content.yml new file mode 100644 index 000000000..ff90603a0 --- /dev/null +++ b/config/update/thunder_add_config_selector_to_content.yml @@ -0,0 +1,8 @@ +views.view.content: + expected_config: { } + update_actions: + add: + third_party_settings: + config_selector: + feature: thunder_content_view + priority: 0 diff --git a/config/update/thunder_add_config_selector_to_content_media.yml b/config/update/thunder_add_config_selector_to_content_media.yml deleted file mode 100644 index 8d863aa58..000000000 --- a/config/update/thunder_add_config_selector_to_content_media.yml +++ /dev/null @@ -1,16 +0,0 @@ -views.view.content: - expected_config: { } - update_actions: - add: - third_party_settings: - config_selector: - feature: thunder_content_view - priority: 0 -views.view.thunder_media: - expected_config: { } - update_actions: - add: - third_party_settings: - config_selector: - feature: thunder_media_view - priority: 0 diff --git a/modules/thunder_article/modules/thunder_riddle/thunder_riddle.module b/modules/thunder_article/modules/thunder_riddle/thunder_riddle.module index 4fb0328df..e81f9cf37 100644 --- a/modules/thunder_article/modules/thunder_riddle/thunder_riddle.module +++ b/modules/thunder_article/modules/thunder_riddle/thunder_riddle.module @@ -9,13 +9,9 @@ * Implements hook_menu_local_actions_alter(). */ function thunder_riddle_menu_local_actions_alter(&$local_actions) { - /** @var \Drupal\config_selector\ActiveEntity $config_selector */ - $config_selector = \Drupal::service('config_selector.active'); - /** @var \Drupal\views\ViewEntityInterface $view */ - $view = $config_selector->get('view', 'thunder_media_view'); - if ($view && $view->status()) { - $view->getExecutable()->initDisplay(); - $local_actions['riddle_marketplace.import']['appears_on'][] = $view->getExecutable()->getUrl()->getRouteName(); + $view = \Drupal::entityTypeManager()->getStorage('view')->load('thunder_media'); + if ($view) { + $local_actions['riddle_marketplace.import']['appears_on'][] = 'view.thunder_media.media_page_list'; } } diff --git a/modules/thunder_media/thunder_media.module b/modules/thunder_media/thunder_media.module index eef74f723..25f1ec703 100644 --- a/modules/thunder_media/thunder_media.module +++ b/modules/thunder_media/thunder_media.module @@ -61,13 +61,9 @@ function thunder_media_page_attachments(array &$page) { * Implements hook_menu_local_actions_alter(). */ function thunder_media_menu_local_actions_alter(&$local_actions) { - /** @var \Drupal\config_selector\ActiveEntity $config_selector */ - $config_selector = \Drupal::service('config_selector.active'); - /** @var \Drupal\views\ViewEntityInterface $view */ - $view = $config_selector->get('view', 'thunder_media_view'); - if ($view && $view->status()) { - $view->getExecutable()->initDisplay(); - $local_actions['media.add']['appears_on'][] = $view->getExecutable()->getUrl()->getRouteName(); + $view = \Drupal::entityTypeManager()->getStorage('view')->load('thunder_media'); + if ($view) { + $local_actions['media.add']['appears_on'][] = 'view.thunder_media.media_page_list'; } } @@ -75,13 +71,9 @@ function thunder_media_menu_local_actions_alter(&$local_actions) { * Implements hook_menu_links_discovered_alter(). */ function thunder_media_menu_links_discovered_alter(&$links) { - /** @var \Drupal\config_selector\ActiveEntity $config_selector */ - $config_selector = \Drupal::service('config_selector.active'); - /** @var \Drupal\views\ViewEntityInterface $view */ - $view = $config_selector->get('view', 'thunder_media_view'); - if ($view && $view->status()) { - $view->getExecutable()->initDisplay(); - $links['entity.media.collection']['route_name'] = $view->getExecutable()->getUrl()->getRouteName(); + $view = \Drupal::entityTypeManager()->getStorage('view')->load('thunder_media'); + if ($view) { + $links['entity.media.collection']['route_name'] = 'view.thunder_media.media_page_list'; } } diff --git a/modules/thunder_updater/updates.yml b/modules/thunder_updater/updates.yml index d566bc955..87c3de3b6 100644 --- a/modules/thunder_updater/updates.yml +++ b/modules/thunder_updater/updates.yml @@ -273,7 +273,7 @@ v2.32: '#title': 'Structure media edit forms.' '#description': '

Configuration is successfully updated.

' '#description_failed': '

Update of configuration has failed.

' - thunder_add_config_selector_to_content_media: + thunder_add_config_selector_to_content: '#title': 'Add config_selector settings to content and media view' '#description': '

Configuration is successfully updated.

' '#description_failed': '

Update of configuration has failed.

' diff --git a/tests/src/Functional/InstalledConfigurationTest.php b/tests/src/Functional/InstalledConfigurationTest.php index c06ee5db8..ee01ae0f2 100644 --- a/tests/src/Functional/InstalledConfigurationTest.php +++ b/tests/src/Functional/InstalledConfigurationTest.php @@ -148,9 +148,6 @@ class InstalledConfigurationTest extends ThunderTestBase { 'views.view.content' => [ 'status' => TRUE, ], - 'views.view.thunder_media' => [ - 'status' => TRUE, - ], 'views.view.glossary' => [ 'dependencies' => [ 'config' => TRUE, diff --git a/thunder.post_update.php b/thunder.post_update.php index f06e88efd..06723c878 100644 --- a/thunder.post_update.php +++ b/thunder.post_update.php @@ -10,31 +10,27 @@ /** * Add config_selector settings to content and media view. */ -function thunder_post_update_add_config_selector_to_content_media() { +function thunder_post_update_add_config_selector_to_content() { /** @var \Drupal\thunder_updater\Updater $thunderUpdater */ $thunderUpdater = \Drupal::service('thunder_updater'); // Execute configuration update definitions with logging of success. - if ($thunderUpdater->executeUpdates([['thunder', 'thunder_add_config_selector_to_content_media']])) { + if ($thunderUpdater->executeUpdates([['thunder', 'thunder_add_config_selector_to_content']])) { if ($view = View::load('content')) { $view->save(); } - if ($view = View::load('thunder_media')) { - $view->save(); - } try { /** @var \Drupal\config_update\ConfigReverter $configReverter */ $configReverter = \Drupal::service('config_update.config_update'); $configReverter->import('config_selector_feature', 'thunder_content_view'); - $configReverter->import('config_selector_feature', 'thunder_media_view'); - $thunderUpdater->checklist()->markUpdatesSuccessful(['thunder_add_config_selector_to_content_media']); + $thunderUpdater->checklist()->markUpdatesSuccessful(['thunder_add_config_selector_to_content']); } catch (\Exception $exception) { - $thunderUpdater->checklist()->markUpdatesFailed(['thunder_add_config_selector_to_content_media']); + $thunderUpdater->checklist()->markUpdatesFailed(['thunder_add_config_selector_to_content']); } } else { - $thunderUpdater->checklist()->markUpdatesFailed(['thunder_add_config_selector_to_content_media']); + $thunderUpdater->checklist()->markUpdatesFailed(['thunder_add_config_selector_to_content']); } // Output logged messages to related channel of update execution. From 99d97d4bf6c7b772b2fe3ab82b9b9c11a1752419 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 7 Feb 2019 10:09:07 +0100 Subject: [PATCH 111/134] Remove core patch --- composer.json | 3 --- drupal-org-core.make | 1 - 2 files changed, 4 deletions(-) diff --git a/composer.json b/composer.json index 3d360e402..b5d89a331 100644 --- a/composer.json +++ b/composer.json @@ -74,9 +74,6 @@ "drupal/scheduler": { "Deny edit access to scheduled content for unprivileged users": "https://www.drupal.org/files/issues/2018-12-18/3020250-8.patch" }, - "drupal/core": { - "Extension objects should not implement \\Serializable": "https://www.drupal.org/files/issues/2018-12-18/2701829-8.6.x-112.patch" - }, "drupal/password_policy": { "Policies should declare a config dependency on the plugin modules": "https://www.drupal.org/files/issues/2018-10-09/2918974-2.patch", "Importing configuration on site without password_policy activated": "https://www.drupal.org/files/issues/2018-07-30/password_policy-config_import_field_error-2771129-57.patch" diff --git a/drupal-org-core.make b/drupal-org-core.make index e5e44bd1d..314d87976 100644 --- a/drupal-org-core.make +++ b/drupal-org-core.make @@ -2,4 +2,3 @@ api = 2 core = 8.x projects[drupal][type] = core projects[drupal][version] = 8.6.7 -projects[drupal][patch][] = https://www.drupal.org/files/issues/2018-12-18/2701829-8.6.x-112.patch From b083776c204b6509ab92e2eff6a6456a310982b6 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 7 Feb 2019 10:54:46 +0100 Subject: [PATCH 112/134] Use block building in our facet block --- drupal-org-core.make | 2 +- src/Plugin/views/area/FacetBlock.php | 35 +++++++++++++++++----------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/drupal-org-core.make b/drupal-org-core.make index 314d87976..93a205471 100644 --- a/drupal-org-core.make +++ b/drupal-org-core.make @@ -1,4 +1,4 @@ api = 2 core = 8.x projects[drupal][type] = core -projects[drupal][version] = 8.6.7 +projects[drupal][version] = 8.6.8 diff --git a/src/Plugin/views/area/FacetBlock.php b/src/Plugin/views/area/FacetBlock.php index dd39537b5..81cdf4925 100644 --- a/src/Plugin/views/area/FacetBlock.php +++ b/src/Plugin/views/area/FacetBlock.php @@ -2,6 +2,8 @@ namespace Drupal\thunder\Plugin\views\area; +use Drupal\Core\Block\BlockManagerInterface; +use Drupal\Core\Session\AccountInterface; use Drupal\facets\FacetManager\DefaultFacetManager; use Drupal\facets\FacetSource\FacetSourcePluginManager; use Drupal\views\Plugin\views\area\AreaPluginBase; @@ -20,20 +22,26 @@ class FacetBlock extends AreaPluginBase { protected $facetSourceManager; + protected $blockManager; + + protected $currentUser; + /** * {@inheritdoc} */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, DefaultFacetManager $facetManager, FacetSourcePluginManager $facetSourceManager) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, DefaultFacetManager $facetManager, FacetSourcePluginManager $facetSourceManager, BlockManagerInterface $blockManager, AccountInterface $account) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->facetManager = $facetManager; $this->facetSourceManager = $facetSourceManager; + $this->blockManager = $blockManager; + $this->currentUser = $account; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static($configuration, $plugin_id, $plugin_definition, $container->get('facets.manager'), $container->get('plugin.manager.facets.facet_source')); + return new static($configuration, $plugin_id, $plugin_definition, $container->get('facets.manager'), $container->get('plugin.manager.facets.facet_source'), $container->get('plugin.manager.block'), $container->get('current_user')); } /** @@ -47,6 +55,7 @@ public function render($empty = FALSE) { $source = $this->facetSourceManager->createInstance($definition['id']); if ($this->view->id() == $source->getViewsDisplay()->id() && $this->view->current_display == $source->getViewsDisplay()->current_display) { $facet_source = $source; + break; } } @@ -61,20 +70,18 @@ public function render($empty = FALSE) { return $build; } foreach ($this->facetManager->getFacetsByFacetSourceId($facet_source->pluginId) as $id => $facet) { - // No need to build the facet if it does not need to be visible. - if (($facet->getOnlyVisibleWhenFacetSourceIsVisible() && !$facet->getFacetSource()->isRenderedInCurrentRequest())) { - continue; - } - $config = $facet->getFacetSource()->getDisplay()->getPluginDefinition(); + /** @var \Drupal\Core\Block\BlockPluginInterface $plugin_block */ + $plugin_block = $this->blockManager->createInstance('facet_block:' . $facet->id(), []); - if ($config['view_id'] != $this->view->id() || $config['view_display'] != $this->view->current_display) { - continue; - } - $built_facet = $this->facetManager->build($facet); - if (in_array('facet-empty', $built_facet[0]['#attributes']['class'])) { - continue; + // Some blocks might implement access check. + $access_result = $plugin_block->access($this->currentUser); + + // Return empty render array if user doesn't have access. $access_result + // can be boolean or an AccessResult class. + if (is_object($access_result) && $access_result->isForbidden() || is_bool($access_result) && !$access_result) { + return []; } - $build['facets'][$id] = $built_facet + [ + $build['facets'][$id] = $plugin_block->build() + [ '#weight' => $facet->getWeight(), ]; } From 7d9f5ebdd0da385672a458e96003c984c59899a2 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 7 Feb 2019 11:45:25 +0100 Subject: [PATCH 113/134] Simplify code --- src/Plugin/views/area/FacetBlock.php | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/Plugin/views/area/FacetBlock.php b/src/Plugin/views/area/FacetBlock.php index 81cdf4925..abbc1d2c4 100644 --- a/src/Plugin/views/area/FacetBlock.php +++ b/src/Plugin/views/area/FacetBlock.php @@ -5,7 +5,6 @@ use Drupal\Core\Block\BlockManagerInterface; use Drupal\Core\Session\AccountInterface; use Drupal\facets\FacetManager\DefaultFacetManager; -use Drupal\facets\FacetSource\FacetSourcePluginManager; use Drupal\views\Plugin\views\area\AreaPluginBase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -20,8 +19,6 @@ class FacetBlock extends AreaPluginBase { protected $facetManager; - protected $facetSourceManager; - protected $blockManager; protected $currentUser; @@ -29,10 +26,9 @@ class FacetBlock extends AreaPluginBase { /** * {@inheritdoc} */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, DefaultFacetManager $facetManager, FacetSourcePluginManager $facetSourceManager, BlockManagerInterface $blockManager, AccountInterface $account) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, DefaultFacetManager $facetManager, BlockManagerInterface $blockManager, AccountInterface $account) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->facetManager = $facetManager; - $this->facetSourceManager = $facetSourceManager; $this->blockManager = $blockManager; $this->currentUser = $account; } @@ -41,7 +37,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static($configuration, $plugin_id, $plugin_definition, $container->get('facets.manager'), $container->get('plugin.manager.facets.facet_source'), $container->get('plugin.manager.block'), $container->get('current_user')); + return new static($configuration, $plugin_id, $plugin_definition, $container->get('facets.manager'), $container->get('plugin.manager.block'), $container->get('current_user')); } /** @@ -49,16 +45,6 @@ public static function create(ContainerInterface $container, array $configuratio */ public function render($empty = FALSE) { - $facet_source = NULL; - foreach ($this->facetSourceManager->getDefinitions() as $definition) { - /** @var \Drupal\facets\Plugin\facets\facet_source\SearchApiDisplay $source */ - $source = $this->facetSourceManager->createInstance($definition['id']); - if ($this->view->id() == $source->getViewsDisplay()->id() && $this->view->current_display == $source->getViewsDisplay()->current_display) { - $facet_source = $source; - break; - } - } - $build = [ '#type' => 'container', '#attributes' => ['class' => 'form--inline clearfix'], @@ -66,10 +52,12 @@ public function render($empty = FALSE) { ]; $build['exposed_form']['#attributes']['class'][] = 'form-item'; - if (!$facet_source || !$this->view->result) { + if (!$this->view->result) { return $build; } - foreach ($this->facetManager->getFacetsByFacetSourceId($facet_source->pluginId) as $id => $facet) { + + $facets_source_plugin_id = 'search_api:views_' . $this->view->getDisplay()->getPluginId() . '__' . $this->view->id() . '__' . $this->view->current_display; + foreach ($this->facetManager->getFacetsByFacetSourceId($facets_source_plugin_id) as $id => $facet) { /** @var \Drupal\Core\Block\BlockPluginInterface $plugin_block */ $plugin_block = $this->blockManager->createInstance('facet_block:' . $facet->id(), []); From e3309fd67439d2cc324025c79efbf1cb0193bebe Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Fri, 8 Feb 2019 09:51:08 +0100 Subject: [PATCH 114/134] Render facet all the time --- config/optional/facets.facet.author.yml | 2 +- config/optional/facets.facet.channel.yml | 2 +- config/optional/facets.facet.promoted_to_front_page.yml | 2 +- config/optional/facets.facet.status.yml | 2 +- config/optional/facets.facet.sticky_at_top_of_lists.yml | 2 +- config/optional/facets.facet.tags.yml | 2 +- config/optional/facets.facet.type.yml | 2 +- config/optional/views.view.content_search_api.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/optional/facets.facet.author.yml b/config/optional/facets.facet.author.yml index 1cab7abc1..fc711ed2a 100644 --- a/config/optional/facets.facet.author.yml +++ b/config/optional/facets.facet.author.yml @@ -27,7 +27,7 @@ expand_hierarchy: false enable_parent_when_child_gets_disabled: true hard_limit: 20 exclude: false -only_visible_when_facet_source_is_visible: true +only_visible_when_facet_source_is_visible: false processor_configs: active_widget_order: processor_id: active_widget_order diff --git a/config/optional/facets.facet.channel.yml b/config/optional/facets.facet.channel.yml index 5695f9e64..496b157d2 100644 --- a/config/optional/facets.facet.channel.yml +++ b/config/optional/facets.facet.channel.yml @@ -27,7 +27,7 @@ expand_hierarchy: true enable_parent_when_child_gets_disabled: true hard_limit: 250 exclude: false -only_visible_when_facet_source_is_visible: true +only_visible_when_facet_source_is_visible: false processor_configs: active_widget_order: processor_id: active_widget_order diff --git a/config/optional/facets.facet.promoted_to_front_page.yml b/config/optional/facets.facet.promoted_to_front_page.yml index 423b6c258..8280ab50d 100644 --- a/config/optional/facets.facet.promoted_to_front_page.yml +++ b/config/optional/facets.facet.promoted_to_front_page.yml @@ -27,7 +27,7 @@ expand_hierarchy: false enable_parent_when_child_gets_disabled: true hard_limit: 3 exclude: false -only_visible_when_facet_source_is_visible: true +only_visible_when_facet_source_is_visible: false processor_configs: boolean_item: processor_id: boolean_item diff --git a/config/optional/facets.facet.status.yml b/config/optional/facets.facet.status.yml index 18a63623f..7e8a006e4 100644 --- a/config/optional/facets.facet.status.yml +++ b/config/optional/facets.facet.status.yml @@ -27,7 +27,7 @@ expand_hierarchy: false enable_parent_when_child_gets_disabled: true hard_limit: 3 exclude: false -only_visible_when_facet_source_is_visible: true +only_visible_when_facet_source_is_visible: false processor_configs: boolean_item: processor_id: boolean_item diff --git a/config/optional/facets.facet.sticky_at_top_of_lists.yml b/config/optional/facets.facet.sticky_at_top_of_lists.yml index 7b69f3205..1e9eb1b03 100644 --- a/config/optional/facets.facet.sticky_at_top_of_lists.yml +++ b/config/optional/facets.facet.sticky_at_top_of_lists.yml @@ -27,7 +27,7 @@ expand_hierarchy: false enable_parent_when_child_gets_disabled: true hard_limit: 3 exclude: false -only_visible_when_facet_source_is_visible: true +only_visible_when_facet_source_is_visible: false processor_configs: boolean_item: processor_id: boolean_item diff --git a/config/optional/facets.facet.tags.yml b/config/optional/facets.facet.tags.yml index 1abc37dca..4f0397104 100644 --- a/config/optional/facets.facet.tags.yml +++ b/config/optional/facets.facet.tags.yml @@ -27,7 +27,7 @@ expand_hierarchy: true enable_parent_when_child_gets_disabled: true hard_limit: 50 exclude: false -only_visible_when_facet_source_is_visible: true +only_visible_when_facet_source_is_visible: false processor_configs: active_widget_order: processor_id: active_widget_order diff --git a/config/optional/facets.facet.type.yml b/config/optional/facets.facet.type.yml index 1c488deee..0d37b3d50 100644 --- a/config/optional/facets.facet.type.yml +++ b/config/optional/facets.facet.type.yml @@ -27,7 +27,7 @@ expand_hierarchy: false enable_parent_when_child_gets_disabled: true hard_limit: 50 exclude: false -only_visible_when_facet_source_is_visible: true +only_visible_when_facet_source_is_visible: false processor_configs: active_widget_order: processor_id: active_widget_order diff --git a/config/optional/views.view.content_search_api.yml b/config/optional/views.view.content_search_api.yml index 46039690e..bb65e3341 100644 --- a/config/optional/views.view.content_search_api.yml +++ b/config/optional/views.view.content_search_api.yml @@ -934,7 +934,7 @@ display: relationships: { } arguments: { } display_extenders: { } - use_ajax: false + use_ajax: true filter_groups: operator: AND groups: From 0549f619e3178f0e02723f6dbd7620f1016b3c9d Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Fri, 8 Feb 2019 13:45:09 +0100 Subject: [PATCH 115/134] Use facet blocks --- ...block.block.thunder_admin_facet_author.yml | 22 +++++ ...lock.block.thunder_admin_facet_channel.yml | 22 +++++ ...ock.block.thunder_admin_facet_promoted.yml | 22 +++++ ...block.block.thunder_admin_facet_status.yml | 22 +++++ ...block.block.thunder_admin_facet_sticky.yml | 22 +++++ .../block.block.thunder_admin_facet_tags.yml | 22 +++++ .../block.block.thunder_admin_facet_type.yml | 22 +++++ config/optional/facets.facet.author.yml | 2 +- config/optional/facets.facet.channel.yml | 2 +- .../facets.facet.promoted_to_front_page.yml | 4 +- config/optional/facets.facet.status.yml | 2 +- .../facets.facet.sticky_at_top_of_lists.yml | 4 +- config/optional/facets.facet.tags.yml | 2 +- config/optional/facets.facet.type.yml | 2 +- .../views.view.content_search_api.yml | 10 --- src/Plugin/views/area/FacetBlock.php | 80 ------------------- 16 files changed, 163 insertions(+), 99 deletions(-) create mode 100644 config/optional/block.block.thunder_admin_facet_author.yml create mode 100644 config/optional/block.block.thunder_admin_facet_channel.yml create mode 100644 config/optional/block.block.thunder_admin_facet_promoted.yml create mode 100644 config/optional/block.block.thunder_admin_facet_status.yml create mode 100644 config/optional/block.block.thunder_admin_facet_sticky.yml create mode 100644 config/optional/block.block.thunder_admin_facet_tags.yml create mode 100644 config/optional/block.block.thunder_admin_facet_type.yml delete mode 100644 src/Plugin/views/area/FacetBlock.php diff --git a/config/optional/block.block.thunder_admin_facet_author.yml b/config/optional/block.block.thunder_admin_facet_author.yml new file mode 100644 index 000000000..0f7798e44 --- /dev/null +++ b/config/optional/block.block.thunder_admin_facet_author.yml @@ -0,0 +1,22 @@ +langcode: en +status: true +dependencies: + config: + - facets.facet.author + module: + - facets + theme: + - thunder_admin +id: thunder_admin_facet_author +theme: thunder_admin +region: content +weight: -5 +provider: null +plugin: 'facet_block:author' +settings: + id: 'facet_block:author' + label: Author + provider: facets + label_display: '0' + block_id: author +visibility: { } diff --git a/config/optional/block.block.thunder_admin_facet_channel.yml b/config/optional/block.block.thunder_admin_facet_channel.yml new file mode 100644 index 000000000..0f3103c0b --- /dev/null +++ b/config/optional/block.block.thunder_admin_facet_channel.yml @@ -0,0 +1,22 @@ +langcode: en +status: true +dependencies: + config: + - facets.facet.channel + module: + - facets + theme: + - thunder_admin +id: thunder_admin_facet_channel +theme: thunder_admin +region: content +weight: -7 +provider: null +plugin: 'facet_block:channel' +settings: + id: 'facet_block:channel' + label: Channel + provider: facets + label_display: '0' + block_id: channel +visibility: { } diff --git a/config/optional/block.block.thunder_admin_facet_promoted.yml b/config/optional/block.block.thunder_admin_facet_promoted.yml new file mode 100644 index 000000000..9f836f66d --- /dev/null +++ b/config/optional/block.block.thunder_admin_facet_promoted.yml @@ -0,0 +1,22 @@ +langcode: en +status: true +dependencies: + config: + - facets.facet.promoted_to_front_page + module: + - facets + theme: + - thunder_admin +id: thunder_admin_facet_promoted +theme: thunder_admin +region: content +weight: -2 +provider: null +plugin: 'facet_block:promoted_to_front_page' +settings: + id: 'facet_block:promoted_to_front_page' + label: Promoted + provider: facets + label_display: '0' + block_id: promoted +visibility: { } diff --git a/config/optional/block.block.thunder_admin_facet_status.yml b/config/optional/block.block.thunder_admin_facet_status.yml new file mode 100644 index 000000000..33feafa36 --- /dev/null +++ b/config/optional/block.block.thunder_admin_facet_status.yml @@ -0,0 +1,22 @@ +langcode: en +status: true +dependencies: + config: + - facets.facet.status + module: + - facets + theme: + - thunder_admin +id: thunder_admin_facet_status +theme: thunder_admin +region: content +weight: -3 +provider: null +plugin: 'facet_block:status' +settings: + id: 'facet_block:status' + label: Status + provider: facets + label_display: '0' + block_id: status +visibility: { } diff --git a/config/optional/block.block.thunder_admin_facet_sticky.yml b/config/optional/block.block.thunder_admin_facet_sticky.yml new file mode 100644 index 000000000..c2e1c92eb --- /dev/null +++ b/config/optional/block.block.thunder_admin_facet_sticky.yml @@ -0,0 +1,22 @@ +langcode: en +status: true +dependencies: + config: + - facets.facet.sticky_at_top_of_lists + module: + - facets + theme: + - thunder_admin +id: thunder_admin_facet_sticky +theme: thunder_admin +region: content +weight: -1 +provider: null +plugin: 'facet_block:sticky_at_top_of_lists' +settings: + id: 'facet_block:sticky_at_top_of_lists' + label: Sticky + provider: facets + label_display: '0' + block_id: sticky +visibility: { } diff --git a/config/optional/block.block.thunder_admin_facet_tags.yml b/config/optional/block.block.thunder_admin_facet_tags.yml new file mode 100644 index 000000000..4cb38fb45 --- /dev/null +++ b/config/optional/block.block.thunder_admin_facet_tags.yml @@ -0,0 +1,22 @@ +langcode: en +status: true +dependencies: + config: + - facets.facet.tags + module: + - facets + theme: + - thunder_admin +id: thunder_admin_facet_tags +theme: thunder_admin +region: content +weight: -6 +provider: null +plugin: 'facet_block:tags' +settings: + id: 'facet_block:tags' + label: Tags + provider: facets + label_display: '0' + block_id: tags +visibility: { } diff --git a/config/optional/block.block.thunder_admin_facet_type.yml b/config/optional/block.block.thunder_admin_facet_type.yml new file mode 100644 index 000000000..df3260618 --- /dev/null +++ b/config/optional/block.block.thunder_admin_facet_type.yml @@ -0,0 +1,22 @@ +langcode: en +status: true +dependencies: + config: + - facets.facet.type + module: + - facets + theme: + - thunder_admin +id: thunder_admin_facet_type +theme: thunder_admin +region: content +weight: -4 +provider: null +plugin: 'facet_block:type' +settings: + id: 'facet_block:type' + label: Type + provider: facets + label_display: '0' + block_id: type +visibility: { } diff --git a/config/optional/facets.facet.author.yml b/config/optional/facets.facet.author.yml index fc711ed2a..1cab7abc1 100644 --- a/config/optional/facets.facet.author.yml +++ b/config/optional/facets.facet.author.yml @@ -27,7 +27,7 @@ expand_hierarchy: false enable_parent_when_child_gets_disabled: true hard_limit: 20 exclude: false -only_visible_when_facet_source_is_visible: false +only_visible_when_facet_source_is_visible: true processor_configs: active_widget_order: processor_id: active_widget_order diff --git a/config/optional/facets.facet.channel.yml b/config/optional/facets.facet.channel.yml index 496b157d2..5695f9e64 100644 --- a/config/optional/facets.facet.channel.yml +++ b/config/optional/facets.facet.channel.yml @@ -27,7 +27,7 @@ expand_hierarchy: true enable_parent_when_child_gets_disabled: true hard_limit: 250 exclude: false -only_visible_when_facet_source_is_visible: false +only_visible_when_facet_source_is_visible: true processor_configs: active_widget_order: processor_id: active_widget_order diff --git a/config/optional/facets.facet.promoted_to_front_page.yml b/config/optional/facets.facet.promoted_to_front_page.yml index 8280ab50d..73a7bb37b 100644 --- a/config/optional/facets.facet.promoted_to_front_page.yml +++ b/config/optional/facets.facet.promoted_to_front_page.yml @@ -18,7 +18,7 @@ widget: type: select2 config: show_numbers: true - width: 100% + width: 10% autocomplete: false match_operator: CONTAINS query_operator: or @@ -27,7 +27,7 @@ expand_hierarchy: false enable_parent_when_child_gets_disabled: true hard_limit: 3 exclude: false -only_visible_when_facet_source_is_visible: false +only_visible_when_facet_source_is_visible: true processor_configs: boolean_item: processor_id: boolean_item diff --git a/config/optional/facets.facet.status.yml b/config/optional/facets.facet.status.yml index 7e8a006e4..18a63623f 100644 --- a/config/optional/facets.facet.status.yml +++ b/config/optional/facets.facet.status.yml @@ -27,7 +27,7 @@ expand_hierarchy: false enable_parent_when_child_gets_disabled: true hard_limit: 3 exclude: false -only_visible_when_facet_source_is_visible: false +only_visible_when_facet_source_is_visible: true processor_configs: boolean_item: processor_id: boolean_item diff --git a/config/optional/facets.facet.sticky_at_top_of_lists.yml b/config/optional/facets.facet.sticky_at_top_of_lists.yml index 1e9eb1b03..be4d22cd8 100644 --- a/config/optional/facets.facet.sticky_at_top_of_lists.yml +++ b/config/optional/facets.facet.sticky_at_top_of_lists.yml @@ -18,7 +18,7 @@ widget: type: select2 config: show_numbers: true - width: 100% + width: 10% autocomplete: false match_operator: CONTAINS query_operator: or @@ -27,7 +27,7 @@ expand_hierarchy: false enable_parent_when_child_gets_disabled: true hard_limit: 3 exclude: false -only_visible_when_facet_source_is_visible: false +only_visible_when_facet_source_is_visible: true processor_configs: boolean_item: processor_id: boolean_item diff --git a/config/optional/facets.facet.tags.yml b/config/optional/facets.facet.tags.yml index 4f0397104..1abc37dca 100644 --- a/config/optional/facets.facet.tags.yml +++ b/config/optional/facets.facet.tags.yml @@ -27,7 +27,7 @@ expand_hierarchy: true enable_parent_when_child_gets_disabled: true hard_limit: 50 exclude: false -only_visible_when_facet_source_is_visible: false +only_visible_when_facet_source_is_visible: true processor_configs: active_widget_order: processor_id: active_widget_order diff --git a/config/optional/facets.facet.type.yml b/config/optional/facets.facet.type.yml index 0d37b3d50..1c488deee 100644 --- a/config/optional/facets.facet.type.yml +++ b/config/optional/facets.facet.type.yml @@ -27,7 +27,7 @@ expand_hierarchy: false enable_parent_when_child_gets_disabled: true hard_limit: 50 exclude: false -only_visible_when_facet_source_is_visible: false +only_visible_when_facet_source_is_visible: true processor_configs: active_widget_order: processor_id: active_widget_order diff --git a/config/optional/views.view.content_search_api.yml b/config/optional/views.view.content_search_api.yml index bb65e3341..428bfc8e6 100644 --- a/config/optional/views.view.content_search_api.yml +++ b/config/optional/views.view.content_search_api.yml @@ -10,7 +10,6 @@ dependencies: - config_selector - media_entity - search_api - - thunder - user - views_bulk_operations third_party_settings: @@ -920,15 +919,6 @@ display: empty: false content: 'Displaying @start - @end of @total' plugin_id: result - facet_block: - id: facet_block - table: views - field: facet_block - relationship: none - group_type: group - admin_label: '' - empty: false - plugin_id: facet_block footer: { } empty: { } relationships: { } diff --git a/src/Plugin/views/area/FacetBlock.php b/src/Plugin/views/area/FacetBlock.php deleted file mode 100644 index abbc1d2c4..000000000 --- a/src/Plugin/views/area/FacetBlock.php +++ /dev/null @@ -1,80 +0,0 @@ -facetManager = $facetManager; - $this->blockManager = $blockManager; - $this->currentUser = $account; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static($configuration, $plugin_id, $plugin_definition, $container->get('facets.manager'), $container->get('plugin.manager.block'), $container->get('current_user')); - } - - /** - * {@inheritdoc} - */ - public function render($empty = FALSE) { - - $build = [ - '#type' => 'container', - '#attributes' => ['class' => 'form--inline clearfix'], - 'exposed_form' => $this->view->display_handler->viewExposedFormBlocks(), - ]; - $build['exposed_form']['#attributes']['class'][] = 'form-item'; - - if (!$this->view->result) { - return $build; - } - - $facets_source_plugin_id = 'search_api:views_' . $this->view->getDisplay()->getPluginId() . '__' . $this->view->id() . '__' . $this->view->current_display; - foreach ($this->facetManager->getFacetsByFacetSourceId($facets_source_plugin_id) as $id => $facet) { - /** @var \Drupal\Core\Block\BlockPluginInterface $plugin_block */ - $plugin_block = $this->blockManager->createInstance('facet_block:' . $facet->id(), []); - - // Some blocks might implement access check. - $access_result = $plugin_block->access($this->currentUser); - - // Return empty render array if user doesn't have access. $access_result - // can be boolean or an AccessResult class. - if (is_object($access_result) && $access_result->isForbidden() || is_bool($access_result) && !$access_result) { - return []; - } - $build['facets'][$id] = $plugin_block->build() + [ - '#weight' => $facet->getWeight(), - ]; - } - // Return as render array. - return $build; - } - -} From 49f7d4491c0f33eefcb2d78db9d26b92be65907e Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 12 Feb 2019 13:55:00 +0100 Subject: [PATCH 116/134] Make select2 work --- composer.json | 6 +++++- config/optional/block.block.thunder_admin_facet_author.yml | 2 +- config/optional/block.block.thunder_admin_facet_channel.yml | 2 +- .../optional/block.block.thunder_admin_facet_promoted.yml | 2 +- config/optional/block.block.thunder_admin_facet_status.yml | 2 +- config/optional/block.block.thunder_admin_facet_sticky.yml | 2 +- config/optional/block.block.thunder_admin_facet_tags.yml | 2 +- config/optional/block.block.thunder_admin_facet_type.yml | 2 +- 8 files changed, 12 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index b5d89a331..18bc69972 100644 --- a/composer.json +++ b/composer.json @@ -82,7 +82,11 @@ "SearchApiTagCache::getRowId is very expensive": "https://www.drupal.org/files/issues/2019-01-17/3026526.patch" }, "drupal/facets": { - "Improve performance for taxonomy hierarchical facets": "https://www.drupal.org/files/issues/2019-01-30/3005018-8.patch" + "Improve performance for taxonomy hierarchical facets": "https://www.drupal.org/files/issues/2019-01-30/3005018-8.patch", + "Provide JavaScript API for facet widgets": "https://www.drupal.org/files/issues/2019-02-08/3031581_3.patch" + }, + "drupal/select2": { + "Support for AJAX Facets": "https://patch-diff.githubusercontent.com/raw/thunder/select2/pull/54.patch" } } }, diff --git a/config/optional/block.block.thunder_admin_facet_author.yml b/config/optional/block.block.thunder_admin_facet_author.yml index 0f7798e44..fa1886f57 100644 --- a/config/optional/block.block.thunder_admin_facet_author.yml +++ b/config/optional/block.block.thunder_admin_facet_author.yml @@ -18,5 +18,5 @@ settings: label: Author provider: facets label_display: '0' - block_id: author + block_id: thunder_admin_facet_author visibility: { } diff --git a/config/optional/block.block.thunder_admin_facet_channel.yml b/config/optional/block.block.thunder_admin_facet_channel.yml index 0f3103c0b..65b48ffe5 100644 --- a/config/optional/block.block.thunder_admin_facet_channel.yml +++ b/config/optional/block.block.thunder_admin_facet_channel.yml @@ -18,5 +18,5 @@ settings: label: Channel provider: facets label_display: '0' - block_id: channel + block_id: thunder_admin_facet_channel visibility: { } diff --git a/config/optional/block.block.thunder_admin_facet_promoted.yml b/config/optional/block.block.thunder_admin_facet_promoted.yml index 9f836f66d..52bfc8a1d 100644 --- a/config/optional/block.block.thunder_admin_facet_promoted.yml +++ b/config/optional/block.block.thunder_admin_facet_promoted.yml @@ -18,5 +18,5 @@ settings: label: Promoted provider: facets label_display: '0' - block_id: promoted + block_id: thunder_admin_facet_promoted visibility: { } diff --git a/config/optional/block.block.thunder_admin_facet_status.yml b/config/optional/block.block.thunder_admin_facet_status.yml index 33feafa36..4c900ebeb 100644 --- a/config/optional/block.block.thunder_admin_facet_status.yml +++ b/config/optional/block.block.thunder_admin_facet_status.yml @@ -18,5 +18,5 @@ settings: label: Status provider: facets label_display: '0' - block_id: status + block_id: thunder_admin_facet_status visibility: { } diff --git a/config/optional/block.block.thunder_admin_facet_sticky.yml b/config/optional/block.block.thunder_admin_facet_sticky.yml index c2e1c92eb..2a98af918 100644 --- a/config/optional/block.block.thunder_admin_facet_sticky.yml +++ b/config/optional/block.block.thunder_admin_facet_sticky.yml @@ -18,5 +18,5 @@ settings: label: Sticky provider: facets label_display: '0' - block_id: sticky + block_id: thunder_admin_facet_sticky visibility: { } diff --git a/config/optional/block.block.thunder_admin_facet_tags.yml b/config/optional/block.block.thunder_admin_facet_tags.yml index 4cb38fb45..ba808954e 100644 --- a/config/optional/block.block.thunder_admin_facet_tags.yml +++ b/config/optional/block.block.thunder_admin_facet_tags.yml @@ -18,5 +18,5 @@ settings: label: Tags provider: facets label_display: '0' - block_id: tags + block_id: thunder_admin_facet_tags visibility: { } diff --git a/config/optional/block.block.thunder_admin_facet_type.yml b/config/optional/block.block.thunder_admin_facet_type.yml index df3260618..696b8a7b1 100644 --- a/config/optional/block.block.thunder_admin_facet_type.yml +++ b/config/optional/block.block.thunder_admin_facet_type.yml @@ -18,5 +18,5 @@ settings: label: Type provider: facets label_display: '0' - block_id: type + block_id: thunder_admin_facet_type visibility: { } From 32ee3ceab50b1783afd3f65fd43ee6b89a74e116 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 13 Feb 2019 14:12:38 +0100 Subject: [PATCH 117/134] Update facets --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 18bc69972..c792c388a 100644 --- a/composer.json +++ b/composer.json @@ -82,7 +82,7 @@ "SearchApiTagCache::getRowId is very expensive": "https://www.drupal.org/files/issues/2019-01-17/3026526.patch" }, "drupal/facets": { - "Improve performance for taxonomy hierarchical facets": "https://www.drupal.org/files/issues/2019-01-30/3005018-8.patch", + "Missing schema for facet blocks": "https://www.drupal.org/files/issues/2019-02-13/3023187-8.patch", "Provide JavaScript API for facet widgets": "https://www.drupal.org/files/issues/2019-02-08/3031581_3.patch" }, "drupal/select2": { @@ -119,7 +119,7 @@ "drupal/entity_browser": "1.6", "drupal/entity_reference_revisions": "^1.0", "drupal/fb_instant_articles": "dev-1.x", - "drupal/facets": "^1.0", + "drupal/facets": "dev-1.x", "drupal/field_group": "^1.0", "drupal/focal_point": "^1.0", "drupal/google_analytics": "^2.0", From 71250b6fdee0538b5e03f510ed02ee53a2fa5aab Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 14 Feb 2019 10:26:12 +0100 Subject: [PATCH 118/134] Update patches --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c792c388a..4929f6cc3 100644 --- a/composer.json +++ b/composer.json @@ -79,7 +79,8 @@ "Importing configuration on site without password_policy activated": "https://www.drupal.org/files/issues/2018-07-30/password_policy-config_import_field_error-2771129-57.patch" }, "drupal/search_api": { - "SearchApiTagCache::getRowId is very expensive": "https://www.drupal.org/files/issues/2019-01-17/3026526.patch" + "SearchApiTagCache::getRowId is very expensive": "https://www.drupal.org/files/issues/2019-02-14/3026526-7.patch", + "Entity operations should be cached by url": "https://www.drupal.org/files/issues/2019-02-14/3032916.patch" }, "drupal/facets": { "Missing schema for facet blocks": "https://www.drupal.org/files/issues/2019-02-13/3023187-8.patch", From 1f53f2f0244c6a083e114b989a55d7006ad9edcc Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Mon, 18 Feb 2019 09:37:25 +0100 Subject: [PATCH 119/134] New patch --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4929f6cc3..37761f832 100644 --- a/composer.json +++ b/composer.json @@ -80,7 +80,8 @@ }, "drupal/search_api": { "SearchApiTagCache::getRowId is very expensive": "https://www.drupal.org/files/issues/2019-02-14/3026526-7.patch", - "Entity operations should be cached by url": "https://www.drupal.org/files/issues/2019-02-14/3032916.patch" + "Entity operations should be cached by url": "https://www.drupal.org/files/issues/2019-02-14/3032916.patch", + "Facets are lost by Views on keyword search": "https://www.drupal.org/files/issues/2019-02-14/2378945-adjust-to-use-get-query-for-forms-exposed-as-blocks.patch" }, "drupal/facets": { "Missing schema for facet blocks": "https://www.drupal.org/files/issues/2019-02-13/3023187-8.patch", From 3354f4d110ce80e632b330e21a6daa8c01485236 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 20 Feb 2019 12:50:35 +0100 Subject: [PATCH 120/134] Add fulltext block --- ...in_exposedformcontent_search_apipage_1.yml | 28 +++++++++++++++++++ ...block.block.thunder_admin_facet_author.yml | 2 +- ...lock.block.thunder_admin_facet_channel.yml | 2 +- ...ock.block.thunder_admin_facet_promoted.yml | 2 +- ...block.block.thunder_admin_facet_status.yml | 2 +- ...block.block.thunder_admin_facet_sticky.yml | 2 +- .../block.block.thunder_admin_facet_tags.yml | 2 +- .../block.block.thunder_admin_facet_type.yml | 2 +- 8 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 config/optional/block.block.thunder_admin_exposedformcontent_search_apipage_1.yml diff --git a/config/optional/block.block.thunder_admin_exposedformcontent_search_apipage_1.yml b/config/optional/block.block.thunder_admin_exposedformcontent_search_apipage_1.yml new file mode 100644 index 000000000..99781e3b4 --- /dev/null +++ b/config/optional/block.block.thunder_admin_exposedformcontent_search_apipage_1.yml @@ -0,0 +1,28 @@ +langcode: en +status: true +dependencies: + config: + - views.view.content_search_api + module: + - system + - views + theme: + - thunder_admin +id: thunder_admin_exposedformcontent_search_apipage_1 +theme: thunder_admin +region: content +weight: -6 +provider: null +plugin: 'views_exposed_filter_block:content_search_api-page_1' +settings: + id: 'views_exposed_filter_block:content_search_api-page_1' + label: '' + provider: views + label_display: '0' + views_label: '' +visibility: + request_path: + id: request_path + pages: /admin/content + negate: false + context_mapping: { } diff --git a/config/optional/block.block.thunder_admin_facet_author.yml b/config/optional/block.block.thunder_admin_facet_author.yml index fa1886f57..cb0f8aaae 100644 --- a/config/optional/block.block.thunder_admin_facet_author.yml +++ b/config/optional/block.block.thunder_admin_facet_author.yml @@ -10,7 +10,7 @@ dependencies: id: thunder_admin_facet_author theme: thunder_admin region: content -weight: -5 +weight: -3 provider: null plugin: 'facet_block:author' settings: diff --git a/config/optional/block.block.thunder_admin_facet_channel.yml b/config/optional/block.block.thunder_admin_facet_channel.yml index 65b48ffe5..c09f96656 100644 --- a/config/optional/block.block.thunder_admin_facet_channel.yml +++ b/config/optional/block.block.thunder_admin_facet_channel.yml @@ -10,7 +10,7 @@ dependencies: id: thunder_admin_facet_channel theme: thunder_admin region: content -weight: -7 +weight: -5 provider: null plugin: 'facet_block:channel' settings: diff --git a/config/optional/block.block.thunder_admin_facet_promoted.yml b/config/optional/block.block.thunder_admin_facet_promoted.yml index 52bfc8a1d..8e5ed23fb 100644 --- a/config/optional/block.block.thunder_admin_facet_promoted.yml +++ b/config/optional/block.block.thunder_admin_facet_promoted.yml @@ -10,7 +10,7 @@ dependencies: id: thunder_admin_facet_promoted theme: thunder_admin region: content -weight: -2 +weight: 0 provider: null plugin: 'facet_block:promoted_to_front_page' settings: diff --git a/config/optional/block.block.thunder_admin_facet_status.yml b/config/optional/block.block.thunder_admin_facet_status.yml index 4c900ebeb..7ccb82606 100644 --- a/config/optional/block.block.thunder_admin_facet_status.yml +++ b/config/optional/block.block.thunder_admin_facet_status.yml @@ -10,7 +10,7 @@ dependencies: id: thunder_admin_facet_status theme: thunder_admin region: content -weight: -3 +weight: -1 provider: null plugin: 'facet_block:status' settings: diff --git a/config/optional/block.block.thunder_admin_facet_sticky.yml b/config/optional/block.block.thunder_admin_facet_sticky.yml index 2a98af918..ea6e56318 100644 --- a/config/optional/block.block.thunder_admin_facet_sticky.yml +++ b/config/optional/block.block.thunder_admin_facet_sticky.yml @@ -10,7 +10,7 @@ dependencies: id: thunder_admin_facet_sticky theme: thunder_admin region: content -weight: -1 +weight: 1 provider: null plugin: 'facet_block:sticky_at_top_of_lists' settings: diff --git a/config/optional/block.block.thunder_admin_facet_tags.yml b/config/optional/block.block.thunder_admin_facet_tags.yml index ba808954e..0c34b45a3 100644 --- a/config/optional/block.block.thunder_admin_facet_tags.yml +++ b/config/optional/block.block.thunder_admin_facet_tags.yml @@ -10,7 +10,7 @@ dependencies: id: thunder_admin_facet_tags theme: thunder_admin region: content -weight: -6 +weight: -4 provider: null plugin: 'facet_block:tags' settings: diff --git a/config/optional/block.block.thunder_admin_facet_type.yml b/config/optional/block.block.thunder_admin_facet_type.yml index 696b8a7b1..13ef58b34 100644 --- a/config/optional/block.block.thunder_admin_facet_type.yml +++ b/config/optional/block.block.thunder_admin_facet_type.yml @@ -10,7 +10,7 @@ dependencies: id: thunder_admin_facet_type theme: thunder_admin region: content -weight: -4 +weight: -2 provider: null plugin: 'facet_block:type' settings: From 048aab8e5515f417182b88d85f7da5bf7597db2d Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Fri, 22 Feb 2019 09:21:55 +0100 Subject: [PATCH 121/134] Update patches --- composer.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 52d5ab996..938d26939 100644 --- a/composer.json +++ b/composer.json @@ -79,13 +79,12 @@ "Importing configuration on site without password_policy activated": "https://www.drupal.org/files/issues/2018-07-30/password_policy-config_import_field_error-2771129-57.patch" }, "drupal/search_api": { - "SearchApiTagCache::getRowId is very expensive": "https://www.drupal.org/files/issues/2019-02-14/3026526-7.patch", + "SearchApiTagCache::getRowId is very expensive": "https://www.drupal.org/files/issues/2019-02-21/3026526-9.patch", "Entity operations should be cached by url": "https://www.drupal.org/files/issues/2019-02-14/3032916.patch", "Facets are lost by Views on keyword search": "https://www.drupal.org/files/issues/2019-02-14/2378945-adjust-to-use-get-query-for-forms-exposed-as-blocks.patch" }, "drupal/facets": { - "Missing schema for facet blocks": "https://www.drupal.org/files/issues/2019-02-13/3023187-8.patch", - "Provide JavaScript API for facet widgets": "https://www.drupal.org/files/issues/2019-02-08/3031581_3.patch" + "Provide JavaScript API for facet widgets": "https://www.drupal.org/files/issues/2019-02-21/3031581-10.patch" }, "drupal/select2": { "Support for AJAX Facets": "https://patch-diff.githubusercontent.com/raw/thunder/select2/pull/54.patch" From 1a17609c4e9cf1260464fe38ccb91168708f2f75 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Mon, 25 Feb 2019 09:35:36 +0100 Subject: [PATCH 122/134] Remove patch --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index ad9025510..e99d3bd4d 100644 --- a/composer.json +++ b/composer.json @@ -80,8 +80,7 @@ }, "drupal/search_api": { "SearchApiTagCache::getRowId is very expensive": "https://www.drupal.org/files/issues/2019-02-21/3026526-9.patch", - "Entity operations should be cached by url": "https://www.drupal.org/files/issues/2019-02-14/3032916.patch", - "Facets are lost by Views on keyword search": "https://www.drupal.org/files/issues/2019-02-14/2378945-adjust-to-use-get-query-for-forms-exposed-as-blocks.patch" + "Entity operations should be cached by url": "https://www.drupal.org/files/issues/2019-02-14/3032916.patch" }, "drupal/facets": { "Provide JavaScript API for facet widgets": "https://www.drupal.org/files/issues/2019-02-21/3031581-10.patch" From 2e568120982bc0bdb51354ca17e4fd61b7293e37 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Tue, 26 Feb 2019 09:11:10 +0100 Subject: [PATCH 123/134] Remove committed patch --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index e99d3bd4d..a0772c9d4 100644 --- a/composer.json +++ b/composer.json @@ -79,8 +79,7 @@ "Importing configuration on site without password_policy activated": "https://www.drupal.org/files/issues/2018-07-30/password_policy-config_import_field_error-2771129-57.patch" }, "drupal/search_api": { - "SearchApiTagCache::getRowId is very expensive": "https://www.drupal.org/files/issues/2019-02-21/3026526-9.patch", - "Entity operations should be cached by url": "https://www.drupal.org/files/issues/2019-02-14/3032916.patch" + "SearchApiTagCache::getRowId is very expensive": "https://www.drupal.org/files/issues/2019-02-21/3026526-9.patch" }, "drupal/facets": { "Provide JavaScript API for facet widgets": "https://www.drupal.org/files/issues/2019-02-21/3031581-10.patch" From 3f45b29f48fa6584eeacae17a3d0decfbdf17a46 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Wed, 6 Mar 2019 14:22:02 +0100 Subject: [PATCH 124/134] add search_api outdated items flagging --- .../js/thunder_search_api.js | 31 ++++ .../src/SearchApiManager.php | 166 ++++++++++++++++++ .../thunder_search_api.info.yml | 7 + .../thunder_search_api.libraries.yml | 6 + .../thunder_search_api.module | 55 ++++++ 5 files changed, 265 insertions(+) create mode 100644 modules/thunder_search_api/js/thunder_search_api.js create mode 100644 modules/thunder_search_api/src/SearchApiManager.php create mode 100644 modules/thunder_search_api/thunder_search_api.info.yml create mode 100644 modules/thunder_search_api/thunder_search_api.libraries.yml create mode 100644 modules/thunder_search_api/thunder_search_api.module diff --git a/modules/thunder_search_api/js/thunder_search_api.js b/modules/thunder_search_api/js/thunder_search_api.js new file mode 100644 index 000000000..43599d492 --- /dev/null +++ b/modules/thunder_search_api/js/thunder_search_api.js @@ -0,0 +1,31 @@ +/** + * @file thunder_search_api.js + */ + +(function ($, Drupal) { + + 'use strict'; + + /** + * Visually mark outdaed rows and disable vbo checkbox + * + * @type {Object} + */ + Drupal.behaviors.thunderSearchApiFlagOutdatedContent = { + attach: function (context, settings) { + var outdated = settings.thunderSearchApi || []; + + if (outdated.length) { + $('[data-thunder-search-api-id]', context) + .filter(function () { + return outdated.indexOf($(this).data('thunder-search-api-id')) !== -1; + }) + .closest('tr').css('background-color', '#fff4f4') + .find('.views-field-views-bulk-operations-bulk-form input[type="checkbox"]') + .prop('disabled', true); + } + } + }; + + +}(jQuery, Drupal)); diff --git a/modules/thunder_search_api/src/SearchApiManager.php b/modules/thunder_search_api/src/SearchApiManager.php new file mode 100644 index 000000000..c3b8fbbe0 --- /dev/null +++ b/modules/thunder_search_api/src/SearchApiManager.php @@ -0,0 +1,166 @@ +entityTypeManager = $entity_type_manager; + $this->state = $state; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('entity_type.manager'), + $container->get('state') + ); + } + + /** + * Act on entity update. + * + * @param array $indexes + * List of Search API Indexes. + * @param \Drupal\Core\Entity\EntityInterface $entity + * The entity that was just saved. + * + * @see hook_entity_update() + */ + public function entityUpdate(array $indexes, EntityInterface $entity) { + $ids = []; + foreach (array_keys($entity->getTranslationLanguages()) as $langcode) { + $ids[] = $this->createCombinedId($entity, $langcode); + } + foreach ($indexes as $index) { + $this->setOutdated($index, $ids); + } + } + + /** + * Act on recently indexed items. + * + * @param \Drupal\search_api\IndexInterface $index + * Search API Index. + * @param string[] $item_ids + * Indexed entity ids. + * + * @see hook_search_api_items_indexed() + */ + public function itemsIndexed(IndexInterface $index, array $item_ids) { + $outdated_ids = $this->state->get('thunder_search_api_outdated_' . $index->id(), []); + $outdated_ids = array_diff($outdated_ids, $item_ids); + $this->state->set('thunder_search_api_outdated_' . $index->id(), $outdated_ids); + } + + /** + * Stores search_api combinedIds for outdated entities. + * + * @param \Drupal\search_api\IndexInterface $index + * Search API Index. + * @param string[] $ids + * List of ids. + */ + public function setOutdated(IndexInterface $index, array $ids) { + + $ids = $this->state->get('thunder_search_api_outdated_' . $index->id(), []) + $ids; + $this->state->set('thunder_search_api_outdated_' . $index->id(), $ids); + } + + /** + * Check if entity is outdated. + * + * @param \Drupal\search_api\IndexInterface $index + * Search API Index. + * @param string $id + * Entity combined id. + * + * @return bool + * Entity is outdated. + */ + public function isOutdated(IndexInterface $index, $id) { + $outdated = array_flip($this->state->get('thunder_search_api_outdated_' . $index->id(), [])); + + return isset($outdated[$id]); + } + + /** + * Return search_api combinedId for given entity. + * + * @param \Drupal\Core\Entity\EntityInterface $entity + * The entity. + * @param string $langcode + * The language code of the translation to get or + * LanguageInterface::LANGCODE_DEFAULT + * to get the data in default language. + * + * @return string + * The combinedId. + */ + public function createCombinedId(EntityInterface $entity, $langcode = NULL) { + $datasource_id = 'entity:' . $entity->getEntityTypeId(); + if (!$langcode) { + $langcode = $entity->language()->getId(); + } + + return Utility::createCombinedId($datasource_id, $entity->id() . ':' . $langcode); + } + + /** + * Add library and data to view. + * + * @param \Drupal\views\ViewExecutable $view + * The current view object. + */ + public function preprocessView(ViewExecutable $view) { + $index = $view->query->getIndex(); + + foreach ($view->result as $row) { + if (isset($row->search_api_id) && $this->isOutdated($index, $row->search_api_id)) { + $data[] = $row->search_api_id; + } + } + + if (!empty($data)) { + $view->element['#attached']['library'][] = 'thunder_search_api/thunder_search_api'; + $view->element['#attached']['drupalSettings']['thunderSearchApi'] = $data; + } + } + +} diff --git a/modules/thunder_search_api/thunder_search_api.info.yml b/modules/thunder_search_api/thunder_search_api.info.yml new file mode 100644 index 000000000..69945774e --- /dev/null +++ b/modules/thunder_search_api/thunder_search_api.info.yml @@ -0,0 +1,7 @@ +name: 'Thunder Search Api' +description: 'Provide search_api integration for thunder.' +type: module +core: 8.x +dependencies: + - search_api:search_api +package: Thunder diff --git a/modules/thunder_search_api/thunder_search_api.libraries.yml b/modules/thunder_search_api/thunder_search_api.libraries.yml new file mode 100644 index 000000000..ef4113fbe --- /dev/null +++ b/modules/thunder_search_api/thunder_search_api.libraries.yml @@ -0,0 +1,6 @@ +thunder_search_api: + js: + js/thunder_search_api.js: {} + dependencies: + - core/jquery + - core/drupal diff --git a/modules/thunder_search_api/thunder_search_api.module b/modules/thunder_search_api/thunder_search_api.module new file mode 100644 index 000000000..cf256a41c --- /dev/null +++ b/modules/thunder_search_api/thunder_search_api.module @@ -0,0 +1,55 @@ +search_api_skip_tracking) { + return; + } + + $indexes = ContentEntity::getIndexesForEntity($entity); + if (!$indexes) { + return; + } + + \Drupal::service('class_resolver') + ->getInstanceFromDefinition(SearchApiManager::class) + ->entityUpdate($indexes, $entity); +} + +/** + * Implements hook_views_pre_render(). + */ +function thunder_search_api_preprocess_views_view(&$variables) { + /* @var Drupal\views\ViewExecutable $view */ + $view = $variables['view']; + if (!$view->result || !$view->query instanceof SearchApiQuery) { + return; + } + Drupal::service('class_resolver') + ->getInstanceFromDefinition(SearchApiManager::class) + ->preprocessView($view); +} + +/** + * Implements function hook_search_api_items_indexed(). + */ +function thunder_search_api_search_api_items_indexed(IndexInterface $index, array $item_ids) { + \Drupal::service('class_resolver') + ->getInstanceFromDefinition(SearchApiManager::class) + ->itemsIndexed($index, $item_ids); +} From c1e1b6dfb0dd39d2b31e23da432a7c41745ad3c7 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Wed, 6 Mar 2019 15:13:06 +0100 Subject: [PATCH 125/134] Add data attr to search_api view output --- .../views.view.content_search_api.yml | 61 ++++++++++++++++++- 1 file changed, 59 insertions(+), 2 deletions(-) diff --git a/config/optional/views.view.content_search_api.yml b/config/optional/views.view.content_search_api.yml index 428bfc8e6..0a14dcd30 100644 --- a/config/optional/views.view.content_search_api.yml +++ b/config/optional/views.view.content_search_api.yml @@ -87,6 +87,7 @@ display: summary: '' description: '' columns: + search_api_id: search_api_id views_bulk_operations_bulk_form: views_bulk_operations_bulk_form field_teaser_media: field_teaser_media title: title @@ -96,6 +97,13 @@ display: node_changed: node_changed search_api_operations: search_api_operations info: + search_api_id: + sortable: false + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' views_bulk_operations_bulk_form: align: '' separator: '' @@ -151,6 +159,55 @@ display: row: type: fields fields: + search_api_id: + id: search_api_id + table: search_api_index_content + field: search_api_id + relationship: none + group_type: group + admin_label: '' + label: '' + exclude: true + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: false + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + plugin_id: standard views_bulk_operations_bulk_form: id: views_bulk_operations_bulk_form table: views @@ -341,8 +398,8 @@ display: label: Title exclude: false alter: - alter_text: false - text: '' + alter_text: true + text: '{{ title }}' make_link: false path: '' absolute: false From d9bf3ba7dcec4d51801893ad66b187fe0cd3364d Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Wed, 6 Mar 2019 17:03:47 +0100 Subject: [PATCH 126/134] use combined patch to fix views caching --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a0772c9d4..de2097b67 100644 --- a/composer.json +++ b/composer.json @@ -79,7 +79,7 @@ "Importing configuration on site without password_policy activated": "https://www.drupal.org/files/issues/2018-07-30/password_policy-config_import_field_error-2771129-57.patch" }, "drupal/search_api": { - "SearchApiTagCache::getRowId is very expensive": "https://www.drupal.org/files/issues/2019-02-21/3026526-9.patch" + "SearchApi combined patches": "https://www.drupal.org/files/issues/2019-02-22/3026526-9and3034996-4_combined.patch" }, "drupal/facets": { "Provide JavaScript API for facet widgets": "https://www.drupal.org/files/issues/2019-02-21/3031581-10.patch" From c4d811a41479501a871fbb848d8e423a4df31c68 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Wed, 20 Mar 2019 16:23:23 +0100 Subject: [PATCH 127/134] move blocks to theme --- ...in_exposedformcontent_search_apipage_1.yml | 28 ------------------- ...block.block.thunder_admin_facet_author.yml | 22 --------------- ...lock.block.thunder_admin_facet_channel.yml | 22 --------------- ...ock.block.thunder_admin_facet_promoted.yml | 22 --------------- ...block.block.thunder_admin_facet_status.yml | 22 --------------- ...block.block.thunder_admin_facet_sticky.yml | 22 --------------- .../block.block.thunder_admin_facet_tags.yml | 22 --------------- .../block.block.thunder_admin_facet_type.yml | 22 --------------- .../facets.facet.promoted_to_front_page.yml | 2 +- .../facets.facet.sticky_at_top_of_lists.yml | 2 +- config/optional/facets.facet.tags.yml | 2 +- 11 files changed, 3 insertions(+), 185 deletions(-) delete mode 100644 config/optional/block.block.thunder_admin_exposedformcontent_search_apipage_1.yml delete mode 100644 config/optional/block.block.thunder_admin_facet_author.yml delete mode 100644 config/optional/block.block.thunder_admin_facet_channel.yml delete mode 100644 config/optional/block.block.thunder_admin_facet_promoted.yml delete mode 100644 config/optional/block.block.thunder_admin_facet_status.yml delete mode 100644 config/optional/block.block.thunder_admin_facet_sticky.yml delete mode 100644 config/optional/block.block.thunder_admin_facet_tags.yml delete mode 100644 config/optional/block.block.thunder_admin_facet_type.yml diff --git a/config/optional/block.block.thunder_admin_exposedformcontent_search_apipage_1.yml b/config/optional/block.block.thunder_admin_exposedformcontent_search_apipage_1.yml deleted file mode 100644 index 99781e3b4..000000000 --- a/config/optional/block.block.thunder_admin_exposedformcontent_search_apipage_1.yml +++ /dev/null @@ -1,28 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - views.view.content_search_api - module: - - system - - views - theme: - - thunder_admin -id: thunder_admin_exposedformcontent_search_apipage_1 -theme: thunder_admin -region: content -weight: -6 -provider: null -plugin: 'views_exposed_filter_block:content_search_api-page_1' -settings: - id: 'views_exposed_filter_block:content_search_api-page_1' - label: '' - provider: views - label_display: '0' - views_label: '' -visibility: - request_path: - id: request_path - pages: /admin/content - negate: false - context_mapping: { } diff --git a/config/optional/block.block.thunder_admin_facet_author.yml b/config/optional/block.block.thunder_admin_facet_author.yml deleted file mode 100644 index cb0f8aaae..000000000 --- a/config/optional/block.block.thunder_admin_facet_author.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - facets.facet.author - module: - - facets - theme: - - thunder_admin -id: thunder_admin_facet_author -theme: thunder_admin -region: content -weight: -3 -provider: null -plugin: 'facet_block:author' -settings: - id: 'facet_block:author' - label: Author - provider: facets - label_display: '0' - block_id: thunder_admin_facet_author -visibility: { } diff --git a/config/optional/block.block.thunder_admin_facet_channel.yml b/config/optional/block.block.thunder_admin_facet_channel.yml deleted file mode 100644 index c09f96656..000000000 --- a/config/optional/block.block.thunder_admin_facet_channel.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - facets.facet.channel - module: - - facets - theme: - - thunder_admin -id: thunder_admin_facet_channel -theme: thunder_admin -region: content -weight: -5 -provider: null -plugin: 'facet_block:channel' -settings: - id: 'facet_block:channel' - label: Channel - provider: facets - label_display: '0' - block_id: thunder_admin_facet_channel -visibility: { } diff --git a/config/optional/block.block.thunder_admin_facet_promoted.yml b/config/optional/block.block.thunder_admin_facet_promoted.yml deleted file mode 100644 index 8e5ed23fb..000000000 --- a/config/optional/block.block.thunder_admin_facet_promoted.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - facets.facet.promoted_to_front_page - module: - - facets - theme: - - thunder_admin -id: thunder_admin_facet_promoted -theme: thunder_admin -region: content -weight: 0 -provider: null -plugin: 'facet_block:promoted_to_front_page' -settings: - id: 'facet_block:promoted_to_front_page' - label: Promoted - provider: facets - label_display: '0' - block_id: thunder_admin_facet_promoted -visibility: { } diff --git a/config/optional/block.block.thunder_admin_facet_status.yml b/config/optional/block.block.thunder_admin_facet_status.yml deleted file mode 100644 index 7ccb82606..000000000 --- a/config/optional/block.block.thunder_admin_facet_status.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - facets.facet.status - module: - - facets - theme: - - thunder_admin -id: thunder_admin_facet_status -theme: thunder_admin -region: content -weight: -1 -provider: null -plugin: 'facet_block:status' -settings: - id: 'facet_block:status' - label: Status - provider: facets - label_display: '0' - block_id: thunder_admin_facet_status -visibility: { } diff --git a/config/optional/block.block.thunder_admin_facet_sticky.yml b/config/optional/block.block.thunder_admin_facet_sticky.yml deleted file mode 100644 index ea6e56318..000000000 --- a/config/optional/block.block.thunder_admin_facet_sticky.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - facets.facet.sticky_at_top_of_lists - module: - - facets - theme: - - thunder_admin -id: thunder_admin_facet_sticky -theme: thunder_admin -region: content -weight: 1 -provider: null -plugin: 'facet_block:sticky_at_top_of_lists' -settings: - id: 'facet_block:sticky_at_top_of_lists' - label: Sticky - provider: facets - label_display: '0' - block_id: thunder_admin_facet_sticky -visibility: { } diff --git a/config/optional/block.block.thunder_admin_facet_tags.yml b/config/optional/block.block.thunder_admin_facet_tags.yml deleted file mode 100644 index 0c34b45a3..000000000 --- a/config/optional/block.block.thunder_admin_facet_tags.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - facets.facet.tags - module: - - facets - theme: - - thunder_admin -id: thunder_admin_facet_tags -theme: thunder_admin -region: content -weight: -4 -provider: null -plugin: 'facet_block:tags' -settings: - id: 'facet_block:tags' - label: Tags - provider: facets - label_display: '0' - block_id: thunder_admin_facet_tags -visibility: { } diff --git a/config/optional/block.block.thunder_admin_facet_type.yml b/config/optional/block.block.thunder_admin_facet_type.yml deleted file mode 100644 index 13ef58b34..000000000 --- a/config/optional/block.block.thunder_admin_facet_type.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - facets.facet.type - module: - - facets - theme: - - thunder_admin -id: thunder_admin_facet_type -theme: thunder_admin -region: content -weight: -2 -provider: null -plugin: 'facet_block:type' -settings: - id: 'facet_block:type' - label: Type - provider: facets - label_display: '0' - block_id: thunder_admin_facet_type -visibility: { } diff --git a/config/optional/facets.facet.promoted_to_front_page.yml b/config/optional/facets.facet.promoted_to_front_page.yml index 73a7bb37b..1c4d32882 100644 --- a/config/optional/facets.facet.promoted_to_front_page.yml +++ b/config/optional/facets.facet.promoted_to_front_page.yml @@ -18,7 +18,7 @@ widget: type: select2 config: show_numbers: true - width: 10% + width: resolve autocomplete: false match_operator: CONTAINS query_operator: or diff --git a/config/optional/facets.facet.sticky_at_top_of_lists.yml b/config/optional/facets.facet.sticky_at_top_of_lists.yml index be4d22cd8..a3365f399 100644 --- a/config/optional/facets.facet.sticky_at_top_of_lists.yml +++ b/config/optional/facets.facet.sticky_at_top_of_lists.yml @@ -18,7 +18,7 @@ widget: type: select2 config: show_numbers: true - width: 10% + width: resolve autocomplete: false match_operator: CONTAINS query_operator: or diff --git a/config/optional/facets.facet.tags.yml b/config/optional/facets.facet.tags.yml index 1abc37dca..36c0ccc59 100644 --- a/config/optional/facets.facet.tags.yml +++ b/config/optional/facets.facet.tags.yml @@ -18,7 +18,7 @@ widget: type: select2 config: show_numbers: true - width: 300px + width: resolve autocomplete: true match_operator: CONTAINS query_operator: and From 995e61a3261d2eb8ab6d850cf8b904cefd7f0723 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 20 Mar 2019 16:52:41 +0100 Subject: [PATCH 128/134] Move to update helper --- ...to_content.yml => thunder_update_8134.yml} | 3 ++ thunder.install | 12 ++++++ thunder.post_update.php | 38 ------------------- updates_checklist.yml | 9 +++-- 4 files changed, 20 insertions(+), 42 deletions(-) rename config/update/{thunder_add_config_selector_to_content.yml => thunder_update_8134.yml} (68%) delete mode 100644 thunder.post_update.php diff --git a/config/update/thunder_add_config_selector_to_content.yml b/config/update/thunder_update_8134.yml similarity index 68% rename from config/update/thunder_add_config_selector_to_content.yml rename to config/update/thunder_update_8134.yml index ff90603a0..c88f01c94 100644 --- a/config/update/thunder_add_config_selector_to_content.yml +++ b/config/update/thunder_update_8134.yml @@ -1,3 +1,6 @@ +__global_actions: + import_configs: + - config_selector.feature.thunder_content_view views.view.content: expected_config: { } update_actions: diff --git a/thunder.install b/thunder.install index b6a48b2a7..aa04c544c 100644 --- a/thunder.install +++ b/thunder.install @@ -1110,3 +1110,15 @@ function thunder_update_8133() { // Output logged messages to related channel of update execution. return $updater->logger()->output(); } + +/** + * Add config_selector settings to content view. + */ +function thunder_update_8134() { + /** @var \Drupal\update_helper\Updater $updateHelper */ + $updater = \Drupal::service('update_helper.updater'); + $updater->executeUpdate('thunder', 'thunder_update_8134'); + + // Output logged messages to related channel of update execution. + return $updater->logger()->output(); +} diff --git a/thunder.post_update.php b/thunder.post_update.php deleted file mode 100644 index 06723c878..000000000 --- a/thunder.post_update.php +++ /dev/null @@ -1,38 +0,0 @@ -executeUpdates([['thunder', 'thunder_add_config_selector_to_content']])) { - if ($view = View::load('content')) { - $view->save(); - } - try { - /** @var \Drupal\config_update\ConfigReverter $configReverter */ - $configReverter = \Drupal::service('config_update.config_update'); - $configReverter->import('config_selector_feature', 'thunder_content_view'); - $thunderUpdater->checklist()->markUpdatesSuccessful(['thunder_add_config_selector_to_content']); - } - catch (\Exception $exception) { - $thunderUpdater->checklist()->markUpdatesFailed(['thunder_add_config_selector_to_content']); - } - } - else { - $thunderUpdater->checklist()->markUpdatesFailed(['thunder_add_config_selector_to_content']); - } - - // Output logged messages to related channel of update execution. - return $thunderUpdater->logger()->output(); -} diff --git a/updates_checklist.yml b/updates_checklist.yml index 788b54e8a..e93a20929 100644 --- a/updates_checklist.yml +++ b/updates_checklist.yml @@ -310,7 +310,8 @@ v2.36: '#description': '

After the switch to update helper, there are still some configurations that should be changed afterward.

' '#description_successful': '

Configuration related with replacement of Thunder Updater with Update helper is successfully applied.

' '#description_failed': '

Configuration changes related with replacement of Thunder Updater with Update Helper are not properly applied.

' - thunder_add_config_selector_to_content: - '#title': 'Add config_selector settings to content view' - '#description': '

Configuration is successfully updated.

' - '#description_failed': '

Update of configuration has failed.

' + thunder_update_8134: + '#title': 'Add config_selector settings to content view' + '#description': '

Config selector settings have to be added to the content view, to ensure that view switching by the config selector works properly.

' + '#description_successful': '

Settings successfully added.

' + '#description_failed': '

Update of configuration has failed.

' From a06ab073fdedc624bb08a3c1b909d495b0d4f743 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Wed, 20 Mar 2019 16:58:48 +0100 Subject: [PATCH 129/134] REVERT BEFORE COMMIT: switch to thunder_admin branch --- scripts/travis/04-install-thunder.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/travis/04-install-thunder.sh b/scripts/travis/04-install-thunder.sh index a1e82d5a5..1175dd1ae 100755 --- a/scripts/travis/04-install-thunder.sh +++ b/scripts/travis/04-install-thunder.sh @@ -74,7 +74,7 @@ composer_create_thunder() { fi composer config repositories.thunder path ${THUNDER_DIST_DIR} - composer require "burdamagazinorg/thunder:*" "drupal/thunder_admin:dev-2.x" "mglaman/phpstan-drupal" "phpstan/phpstan-deprecation-rules" --no-progress + composer require "burdamagazinorg/thunder:*" "drupal/thunder_admin:dev-feature/3041804-layout_thunder_editorial_search_with_search_api" "mglaman/phpstan-drupal" "phpstan/phpstan-deprecation-rules" --no-progress } apply_patches() { From 28f4efd57a4ecdf5b0bc730b0fc92507b1dfe4a5 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Wed, 20 Mar 2019 17:20:40 +0100 Subject: [PATCH 130/134] Revert "REVERT BEFORE COMMIT: switch to thunder_admin branch" This reverts commit a06ab073fdedc624bb08a3c1b909d495b0d4f743. --- scripts/travis/04-install-thunder.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/travis/04-install-thunder.sh b/scripts/travis/04-install-thunder.sh index 1175dd1ae..a1e82d5a5 100755 --- a/scripts/travis/04-install-thunder.sh +++ b/scripts/travis/04-install-thunder.sh @@ -74,7 +74,7 @@ composer_create_thunder() { fi composer config repositories.thunder path ${THUNDER_DIST_DIR} - composer require "burdamagazinorg/thunder:*" "drupal/thunder_admin:dev-feature/3041804-layout_thunder_editorial_search_with_search_api" "mglaman/phpstan-drupal" "phpstan/phpstan-deprecation-rules" --no-progress + composer require "burdamagazinorg/thunder:*" "drupal/thunder_admin:dev-2.x" "mglaman/phpstan-drupal" "phpstan/phpstan-deprecation-rules" --no-progress } apply_patches() { From 0f0ef0d17cc3e164024ec818ddd415c31d4278a0 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Wed, 20 Mar 2019 17:21:28 +0100 Subject: [PATCH 131/134] REVERT BEFORE COMMIT: switch to thunder_admin branch using composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 626b0f118..fb74a9d0a 100644 --- a/composer.json +++ b/composer.json @@ -152,7 +152,7 @@ "drupal/shariff": "^1.0", "drupal/slick": "^1.0", "drupal/slick_media": "^1.0", - "drupal/thunder_admin": "^1.0 || ^2.0-beta15", + "drupal/thunder_admin": "^dev-feature/3041804-layout_thunder_editorial_search_with_search_api", "drupal/token": "^1.0", "drupal/update_helper": "^1.0", "drupal/video_embed_field": "^1.0", From 28bd98c7fbb6654f28e3c12ad89fb524eef863f6 Mon Sep 17 00:00:00 2001 From: Daniel Bosen Date: Thu, 21 Mar 2019 09:23:17 +0100 Subject: [PATCH 132/134] Fix composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index fb74a9d0a..11094fc81 100644 --- a/composer.json +++ b/composer.json @@ -152,7 +152,7 @@ "drupal/shariff": "^1.0", "drupal/slick": "^1.0", "drupal/slick_media": "^1.0", - "drupal/thunder_admin": "^dev-feature/3041804-layout_thunder_editorial_search_with_search_api", + "drupal/thunder_admin": "dev-feature/3041804-layout_thunder_editorial_search_with_search_api", "drupal/token": "^1.0", "drupal/update_helper": "^1.0", "drupal/video_embed_field": "^1.0", From 5b3c462c3c82ddb450dbdf3960e9e86e82e30ff0 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 21 Mar 2019 15:45:55 +0100 Subject: [PATCH 133/134] Fix branch --- composer.json | 2 +- scripts/travis/04-install-thunder.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 11094fc81..626b0f118 100644 --- a/composer.json +++ b/composer.json @@ -152,7 +152,7 @@ "drupal/shariff": "^1.0", "drupal/slick": "^1.0", "drupal/slick_media": "^1.0", - "drupal/thunder_admin": "dev-feature/3041804-layout_thunder_editorial_search_with_search_api", + "drupal/thunder_admin": "^1.0 || ^2.0-beta15", "drupal/token": "^1.0", "drupal/update_helper": "^1.0", "drupal/video_embed_field": "^1.0", diff --git a/scripts/travis/04-install-thunder.sh b/scripts/travis/04-install-thunder.sh index a1e82d5a5..ea390c274 100755 --- a/scripts/travis/04-install-thunder.sh +++ b/scripts/travis/04-install-thunder.sh @@ -75,6 +75,10 @@ composer_create_thunder() { composer config repositories.thunder path ${THUNDER_DIST_DIR} composer require "burdamagazinorg/thunder:*" "drupal/thunder_admin:dev-2.x" "mglaman/phpstan-drupal" "phpstan/phpstan-deprecation-rules" --no-progress + + # Get custom branch of Thunder Admin theme + rm -rf ${TEST_DIR}/docroot/themes/contrib/thunder_admin + git clone --depth 1 --single-branch --branch "feature/3041804-layout_thunder_editorial_search_with_search_api" https://github.com/BurdaMagazinOrg/theme-thunder-admin.git ${TEST_DIR}/docroot/themes/contrib/thunder_admin } apply_patches() { From 1d31aacfb15a6215a31d0e72ae750d2f780780b2 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Tue, 7 May 2019 09:58:26 +0200 Subject: [PATCH 134/134] use facets release --- composer.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 145fa7b95..6b6f58e8d 100644 --- a/composer.json +++ b/composer.json @@ -81,9 +81,6 @@ "drupal/search_api": { "SearchApiQuery does not implement getCacheTags()": "https://www.drupal.org/files/issues/2019-03-13/3034996-7.patch" }, - "drupal/facets": { - "Provide JavaScript API for facet widgets": "https://www.drupal.org/files/issues/2019-02-21/3031581-10.patch" - }, "drupal/select2": { "Support for AJAX Facets": "https://patch-diff.githubusercontent.com/raw/thunder/select2/pull/54.patch" } @@ -118,7 +115,7 @@ "drupal/entity_browser": "1.7", "drupal/entity_reference_revisions": "^1.0", "drupal/fb_instant_articles": "^1.0", - "drupal/facets": "dev-1.x", + "drupal/facets": "^1.0", "drupal/field_group": "^1.0", "drupal/focal_point": "^1.0", "drupal/google_analytics": "^2.0",