Respect the submission guidelines above! Drupal.org issue forks cause additional work for the project maintainer!

Setup

  • Solr version: 8.8.1
  • Drupal Core version: 9.1.4
  • Search API version: 1.19.0
  • Search API Solr version: 4.1.11
  • Configured Solr Connector:

Issue

Deprecated hook_search_api_views_handler_mapping_alter() is implemented causing
The deprecated alter hook hook_search_api_views_handler_mapping_alter() is implemented in these functions: search_api_solr_search_api_views_handler_mapping_alter. This hook is deprecated in search_api:8.x-1.14 and is removed from search_api:2.0.0. Please use the \"search_api.mapping_views_handlers\" event instead. See https://www.drupal.org/node/3059866

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

csmdgl created an issue. See original summary.

guilhermevp’s picture

Assigned: Unassigned » guilhermevp
guilhermevp’s picture

Version: 4.1.11 » 4.x-dev
Assigned: guilhermevp » Unassigned
Status: Active » Needs review
FileSize
3.48 KB

Sending patch, please review!

mkalkbrenner’s picture

Status: Needs review » Needs work

Thanks for the patch. It already looks good. But we need to change some things:

  1. +++ b/src/SolrListener.php
    @@ -0,0 +1,57 @@
    +class SolrListener implements EventSubscriberInterface {
    

    This class has to be named \Drupal\search_api_solr\EventSubscriber\SearchApiSubscriber

  2. +++ b/src/SolrListener.php
    @@ -0,0 +1,57 @@
    +  public static function getSubscribedEvents() {
    +
    +    return [
    


    Add this code block before "return":

        // Workaround to avoid a fatal error during site install from existing config.
        // @see https://www.drupal.org/project/facets/issues/3199156
        if (!class_exists('\Drupal\search_api\Event\SearchApiEvents', TRUE)) {
          return [];
        }
    
    
KapilV’s picture

Status: Needs work » Needs review
FileSize
3.72 KB
mkalkbrenner’s picture

FileSize
3.83 KB

#5 still has issues with the namespace and function names.

Here's an adjusted patch.

mkalkbrenner’s picture

The patch doesn't work. It seems that nobody here tested the patch :-(

  • mkalkbrenner committed 06ffd85 on 4.x
    Issue #3207690 by guilhermevp, KapilV, mkalkbrenner: Deprecated...
  • mkalkbrenner committed a39696e on 4.x
    Issue #3207690 by mkalkbrenner: Deprecated...
  • mkalkbrenner committed acfc1e1 on 4.x
    Issue #3207690 by guilhermevp, KapilV, mkalkbrenner: Deprecated...
mkalkbrenner’s picture

Status: Needs review » Fixed
mkalkbrenner’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.