diff --git a/profiles/pece/modules/contrib/search_api/CHANGELOG.txt b/profiles/pece/modules/contrib/search_api/CHANGELOG.txt index 6d9ec2c81..208e77d84 100644 --- a/profiles/pece/modules/contrib/search_api/CHANGELOG.txt +++ b/profiles/pece/modules/contrib/search_api/CHANGELOG.txt @@ -1,18 +1,3 @@ -Search API 1.x, dev (xxxx-xx-xx): ---------------------------------- -- #3215213 by drunken monkey: Fixed undefined index "#value" in - SearchApiViewsHandlerFilterFulltext::exposed_validate(). - -Search API 1.28 (2021-07-19): ------------------------------ -- #3208036 by DamienMcKenna, Taran2L, drunken monkey: Fixed PHP 8.0 - compatibility. -- #2159827 by mh86, drunken monkey, farse: Fixed wrong search base paths in - Facet API adapter. -- #3154538 by isholgueras, drunken monkey: Fixed exception handling in - datasource tracking methods. -- #2104623 by drunken monkey: Fixed facet filters for multi-valued date fields. - Search API 1.27 (2021-02-01): ----------------------------- - #3178035 by mvc, drunken monkey: Fixed OR facets for non-numeric hierarchical diff --git a/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/plugins/facetapi/adapter.inc b/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/plugins/facetapi/adapter.inc index d9f89fd3c..f4ff4306d 100644 --- a/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/plugins/facetapi/adapter.inc +++ b/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/plugins/facetapi/adapter.inc @@ -45,7 +45,11 @@ class SearchApiFacetapiAdapter extends FacetapiAdapter { * Overrides FacetapiAdapter::getSearchPath(). */ public function getSearchPath() { - return search_api_facetapi_current_search_path(); + $search = $this->getCurrentSearch(); + if ($search && $search[0]->getOption('search_api_base_path')) { + return $search[0]->getOption('search_api_base_path'); + } + return $_GET['q']; } /** diff --git a/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/plugins/facetapi/query_type_date.inc b/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/plugins/facetapi/query_type_date.inc index 12c77c1a7..6d24064df 100644 --- a/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/plugins/facetapi/query_type_date.inc +++ b/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/plugins/facetapi/query_type_date.inc @@ -73,7 +73,7 @@ class SearchApiFacetapiDate extends SearchApiFacetapiTerm implements FacetapiQue foreach($active_items as $active_item) { $filter = $this->createRangeFilter($active_item['value']); if ($filter) { - $this->addFacetFilter($date_query, $field, $filter, $query); + $this->addFacetFilter($date_query, $field, $filter); } } $query->filter($date_query); diff --git a/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/plugins/facetapi/query_type_term.inc b/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/plugins/facetapi/query_type_term.inc index eb9d74578..25f26b15c 100644 --- a/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/plugins/facetapi/query_type_term.inc +++ b/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/plugins/facetapi/query_type_term.inc @@ -95,7 +95,7 @@ class SearchApiFacetapiTerm extends FacetapiQueryType implements FacetapiQueryTy foreach ($active as $filter => $filter_array) { $field = $this->facet['field']; - $this->addFacetFilter($facet_filter, $field, $filter, $query); + $this->addFacetFilter($facet_filter, $field, $filter); } // Now add the filter to the query. @@ -104,16 +104,6 @@ class SearchApiFacetapiTerm extends FacetapiQueryType implements FacetapiQueryTy /** * Helper method for setting a facet filter on a query or query filter object. - * - * @param SearchApiQueryInterface|SearchApiQueryFilterInterface $query_filter - * The query or filter to which apply the filter. - * @param string $field - * The field to apply the filter to. - * @param string $filter - * The filter, in the internal string representation used by this module. - * @param SearchApiQuery|null $query - * (optional) If available, the search query object should be passed as the - * fourth parameter. */ protected function addFacetFilter($query_filter, $field, $filter) { // Test if this filter should be negated. @@ -128,26 +118,9 @@ class SearchApiFacetapiTerm extends FacetapiQueryType implements FacetapiQueryTy elseif ($filter && $filter[0] == '[' && $filter[strlen($filter) - 1] == ']' && ($pos = strpos($filter, ' TO '))) { $lower = trim(substr($filter, 1, $pos)); $upper = trim(substr($filter, $pos + 4, -1)); - $supports_between = FALSE; - if (func_num_args() > 3) { - $query = func_get_arg(3); - if ($query instanceof SearchApiQuery) { - try { - $supports_between = $query->getIndex()->server() - ->supportsFeature('search_api_between'); - } - catch (SearchApiException $e) { - // Ignore, really not that important (and rather unlikely). - } - } - } if ($lower == '*' && $upper == '*') { $query_filter->condition($field, NULL, $exclude ? '=' : '<>'); } - elseif ($supports_between && $lower != '*' && $upper != '*') { - $operator = $exclude ? 'NOT BETWEEN' : 'BETWEEN'; - $query_filter->condition($field, array($lower, $upper), $operator); - } elseif (!$exclude) { if ($lower != '*') { // Iff we have a range with two finite boundaries, we set two diff --git a/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/search_api_facetapi.info b/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/search_api_facetapi.info index 032b87b8f..6896e0f61 100644 --- a/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/search_api_facetapi.info +++ b/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/search_api_facetapi.info @@ -9,8 +9,8 @@ files[] = plugins/facetapi/adapter.inc files[] = plugins/facetapi/query_type_term.inc files[] = plugins/facetapi/query_type_date.inc -; Information added by Drupal.org packaging script on 2021-09-01 -version = "7.x-1.x-dev" +; Information added by Drupal.org packaging script on 2021-02-01 +version = "7.x-1.27" core = "7.x" project = "search_api" -datestamp = "1630475473" +datestamp = "1612192165" diff --git a/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/search_api_facetapi.module b/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/search_api_facetapi.module index fd4016a5f..eaf25358a 100644 --- a/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/search_api_facetapi.module +++ b/profiles/pece/modules/contrib/search_api/contrib/search_api_facetapi/search_api_facetapi.module @@ -108,16 +108,10 @@ function search_api_facetapi_facetapi_facet_info(array $searcher_info) { $field['key'] = $key; // Determine which, if any, of the field type-specific options will be // used for this field. - if (isset($field['entity_type'])) { - $type = $inner_type = $field['entity_type']; - } - else { - $type = $field['type']; - $inner_type = search_api_extract_inner_type($type); - } - $type_settings += array($inner_type => array()); + $type = isset($field['entity_type']) ? $field['entity_type'] : $field['type']; + $type_settings += array($type => array()); - $facet_info[$key] = $type_settings[$inner_type] + array( + $facet_info[$key] = $type_settings[$type] + array( 'label' => $field['name'], 'description' => t('Filter by @type.', array('@type' => $field['name'])), 'allowed operators' => array( @@ -131,7 +125,7 @@ function search_api_facetapi_facetapi_facet_info(array $searcher_info) { 'map options' => array(), 'field type' => $type, ); - if ($inner_type === 'date') { + if ($type === 'date') { $facet_info[$key]['description'] .= ' ' . t('(Caution: This may perform very poorly for large result sets.)'); } $facet_info[$key]['map options'] += array( @@ -209,7 +203,6 @@ function search_api_facetapi_search_api_query_alter($query) { if ($index->server()->supportsFeature('search_api_facets')) { // This is the main point of communication between the facet system and the // search back-end - it makes the query respond to active facets. - search_api_facetapi_current_search_path($query); $searcher = 'search_api@' . $index->machine_name; $adapter = facetapi_adapter_load($searcher); if ($adapter) { @@ -270,29 +263,6 @@ function search_api_facetapi_date_format_types() { ); } -/** - * Helper function that statically stores the Search API's base path. Can - * either be used to store or retrieve the base path. - * - * This static store is used in SearchApiFacetapiAdapter::getSearchPath() in - * order to retrieve the current search base path. Just relying on - * search_api_current_search() to retrieve the current query is not enough, as - * the path might be requested before the query is finally executed and stored. - * - * @param SearchApiQueryInterface $query - * When storing the base base, the query that is executed. Else NULL. - * - * @return - * The Search API's base path. - */ -function search_api_facetapi_current_search_path(SearchApiQueryInterface $query = NULL) { - $path = &drupal_static(__FUNCTION__, ''); - if ($query && $query->getOption('search_api_base_path')) { - $path = $query->getOption('search_api_base_path'); - } - return $path; -} - /** * Menu callback for the facet settings page. */ diff --git a/profiles/pece/modules/contrib/search_api/contrib/search_api_views/includes/handler_filter_fulltext.inc b/profiles/pece/modules/contrib/search_api/contrib/search_api_views/includes/handler_filter_fulltext.inc index da7823234..58a2fbdeb 100644 --- a/profiles/pece/modules/contrib/search_api/contrib/search_api_views/includes/handler_filter_fulltext.inc +++ b/profiles/pece/modules/contrib/search_api/contrib/search_api_views/includes/handler_filter_fulltext.inc @@ -101,8 +101,8 @@ class SearchApiViewsHandlerFilterFulltext extends SearchApiViewsHandlerFilterTex } // Don't validate on form reset. - if (!empty($form_state['triggering_element']['#value']) - && !empty($form['reset']['#value']) + if (!empty($form_state['triggering_element']) + && !empty($form['reset']) && $form_state['triggering_element']['#value'] === $form['reset']['#value']) { return; } diff --git a/profiles/pece/modules/contrib/search_api/contrib/search_api_views/includes/query.inc b/profiles/pece/modules/contrib/search_api/contrib/search_api_views/includes/query.inc index 68a69b84c..6fb7ea473 100644 --- a/profiles/pece/modules/contrib/search_api/contrib/search_api_views/includes/query.inc +++ b/profiles/pece/modules/contrib/search_api/contrib/search_api_views/includes/query.inc @@ -319,8 +319,11 @@ class SearchApiViewsQuery extends views_plugin_query { $this->query->setOption('search_api_bypass_access', TRUE); } - // Store the Views base path. - $this->query->setOption('search_api_base_path', $this->view->get_path()); + // If the View and the Panel conspire to provide an overridden path then + // pass that through as the base path. + if (!empty($this->view->override_path) && strpos(current_path(), $this->view->override_path) !== 0) { + $this->query->setOption('search_api_base_path', $this->view->override_path); + } // Save query information for Views UI. $view->build_info['query'] = (string) $this->query; diff --git a/profiles/pece/modules/contrib/search_api/contrib/search_api_views/search_api_views.info b/profiles/pece/modules/contrib/search_api/contrib/search_api_views/search_api_views.info index 3fa8227e2..abe7ba37c 100644 --- a/profiles/pece/modules/contrib/search_api/contrib/search_api_views/search_api_views.info +++ b/profiles/pece/modules/contrib/search_api/contrib/search_api_views/search_api_views.info @@ -29,8 +29,8 @@ files[] = includes/plugin_cache.inc files[] = includes/plugin_content_cache.inc files[] = includes/query.inc -; Information added by Drupal.org packaging script on 2021-09-01 -version = "7.x-1.x-dev" +; Information added by Drupal.org packaging script on 2021-02-01 +version = "7.x-1.27" core = "7.x" project = "search_api" -datestamp = "1630475473" +datestamp = "1612192165" diff --git a/profiles/pece/modules/contrib/search_api/includes/datasource.inc b/profiles/pece/modules/contrib/search_api/includes/datasource.inc index 5d2a9ee99..2dd99fd63 100644 --- a/profiles/pece/modules/contrib/search_api/includes/datasource.inc +++ b/profiles/pece/modules/contrib/search_api/includes/datasource.inc @@ -628,22 +628,7 @@ abstract class SearchApiAbstractDataSourceController implements SearchApiDataSou )); } } - try { - $insert->execute(); - } - catch (Exception $e) { - $tmp = array_slice($item_ids, 0, 10); - $item_ids_string = '"' . implode('", "', $tmp) . '"'; - $index_names = array(); - foreach ($indexes as $index) { - $index_names[] = $index->name; - } - $vars = array( - '%indexes' => implode(', ', $index_names), - '@item_ids' => $item_ids_string, - ); - watchdog_exception('search_api', $e, '%type while tracking item inserts (IDs: @item_ids) on index(es) %indexes: !message in %function (line %line of %file).', $vars); - } + $insert->execute(); } } @@ -667,24 +652,8 @@ abstract class SearchApiAbstractDataSourceController implements SearchApiDataSou if ($item_ids !== FALSE) { $update->condition($this->itemIdColumn, $item_ids, 'IN'); } - try { - $update->execute(); - $indexes_by_id[$index->id] = $index; - } - catch (Exception $e) { - if ($item_ids === FALSE) { - $item_ids_string = t('all'); - } - else { - $tmp = array_slice($item_ids, 0, 10); - $item_ids_string = '"' . implode('", "', $tmp) . '"'; - } - $vars = array( - '%index' => $index->name, - '@item_ids' => $item_ids_string, - ); - watchdog_exception('search_api', $e, '%type while tracking item updates (IDs: @item_ids) on index %index: !message in %function (line %line of %file).', $vars); - } + $update->execute(); + $indexes_by_id[$index->id] = $index; } // Determine and return the indexes with any changed items. If $item_ids is @@ -732,24 +701,13 @@ abstract class SearchApiAbstractDataSourceController implements SearchApiDataSou return; } $this->checkIndex($index); - try { - db_update($this->table) - ->fields(array( - $this->changedColumn => 0, - )) - ->condition($this->itemIdColumn, $item_ids, 'IN') - ->condition($this->indexIdColumn, $index->id) - ->execute(); - } - catch (Exception $e) { - $tmp = array_slice($item_ids, 0, 10); - $item_ids_string = '"' . implode('", "', $tmp) . '"'; - $vars = array( - '%index' => $index->name, - '@item_ids' => $item_ids_string, - ); - watchdog_exception('search_api', $e, '%type while tracking indexed items (IDs: @item_ids) on index %index: !message in %function (line %line of %file).', $vars); - } + db_update($this->table) + ->fields(array( + $this->changedColumn => 0, + )) + ->condition($this->itemIdColumn, $item_ids, 'IN') + ->condition($this->indexIdColumn, $index->id) + ->execute(); } /** @@ -767,19 +725,8 @@ abstract class SearchApiAbstractDataSourceController implements SearchApiDataSou $delete = db_delete($this->table) ->condition($this->indexIdColumn, $index->id) ->condition($this->itemIdColumn, $item_ids, 'IN'); - try { - if ($delete->execute()) { - $ret[] = $index; - } - } - catch (Exception $e) { - $tmp = array_slice($item_ids, 0, 10); - $item_ids_string = '"' . implode('", "', $tmp) . '"'; - $vars = array( - '%index' => $index->name, - '@item_ids' => $item_ids_string, - ); - watchdog_exception('search_api', $e, '%type while tracking deleted items (IDs: @item_ids) on index %index: !message in %function (line %line of %file).', $vars); + if ($delete->execute()) { + $ret[] = $index; } } diff --git a/profiles/pece/modules/contrib/search_api/search_api.info b/profiles/pece/modules/contrib/search_api/search_api.info index adc49676d..16cf1a860 100644 --- a/profiles/pece/modules/contrib/search_api/search_api.info +++ b/profiles/pece/modules/contrib/search_api/search_api.info @@ -39,8 +39,8 @@ files[] = includes/service.inc configure = admin/config/search/search_api -; Information added by Drupal.org packaging script on 2021-09-01 -version = "7.x-1.x-dev" +; Information added by Drupal.org packaging script on 2021-02-01 +version = "7.x-1.27" core = "7.x" project = "search_api" -datestamp = "1630475473" +datestamp = "1612192165" diff --git a/profiles/pece/modules/contrib/search_api/search_api.module b/profiles/pece/modules/contrib/search_api/search_api.module index e59fe33c2..07bd94f39 100644 --- a/profiles/pece/modules/contrib/search_api/search_api.module +++ b/profiles/pece/modules/contrib/search_api/search_api.module @@ -3401,7 +3401,7 @@ function _search_api_batch_indexing_create(SearchApiIndex $index, $batch_size, $ * @param $context * An array (or object implementing ArrayAccess) containing the batch context. */ -function _search_api_batch_indexing_callback(SearchApiIndex $index, $batch_size, $limit, $drush, &$context) { +function _search_api_batch_indexing_callback(SearchApiIndex $index, $batch_size, $limit, $drush = FALSE, &$context) { // Persistent data among batch runs. if (!isset($context['sandbox']['limit'])) { $context['sandbox']['limit'] = $limit; diff --git a/profiles/pece/modules/contrib/search_api/tests/search_api_test.info b/profiles/pece/modules/contrib/search_api/tests/search_api_test.info index 287aec099..0bb2aa762 100644 --- a/profiles/pece/modules/contrib/search_api/tests/search_api_test.info +++ b/profiles/pece/modules/contrib/search_api/tests/search_api_test.info @@ -9,8 +9,8 @@ files[] = search_api_test.module hidden = TRUE -; Information added by Drupal.org packaging script on 2021-09-01 -version = "7.x-1.x-dev" +; Information added by Drupal.org packaging script on 2021-02-01 +version = "7.x-1.27" core = "7.x" project = "search_api" -datestamp = "1630475473" +datestamp = "1612192165" diff --git a/profiles/pece/modules/contrib/search_api/tests/search_api_test_2.info b/profiles/pece/modules/contrib/search_api/tests/search_api_test_2.info index ed1a0d84a..65344f201 100644 --- a/profiles/pece/modules/contrib/search_api/tests/search_api_test_2.info +++ b/profiles/pece/modules/contrib/search_api/tests/search_api_test_2.info @@ -9,8 +9,8 @@ files[] = search_api_test_service_2.module hidden = TRUE -; Information added by Drupal.org packaging script on 2021-09-01 -version = "7.x-1.x-dev" +; Information added by Drupal.org packaging script on 2021-02-01 +version = "7.x-1.27" core = "7.x" project = "search_api" -datestamp = "1630475473" +datestamp = "1612192165" diff --git a/profiles/pece/pece.make b/profiles/pece/pece.make index d2896db1b..8c42463d0 100644 --- a/profiles/pece/pece.make +++ b/profiles/pece/pece.make @@ -466,7 +466,7 @@ projects[color_field][version] = 1.8 ; Search API ; Overrides panopoly's search_api settings. projects[search_api][subdir] = contrib -projects[search_api][version] = 1.x +projects[search_api][version] = 1.27 projects[search_api][patch][] = ./patches/search_api_fix-composer-friendly-dependencies-issue.patch ; Search API DB