Problem/Motivation

Drupal 10 will be released soon #3251854: [META] Requirements for tagging Drupal 10.0.0-alpha1. We should ensure that search_api_autocomplete is compatible with it.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

paulocs created an issue. See original summary.

Lal_’s picture

StatusFileSize
new9.36 KB
Lal_’s picture

StatusFileSize
new13.99 KB
Lal_’s picture

StatusFileSize
new13.93 KB
Lal_’s picture

StatusFileSize
new14.35 KB
Lal_’s picture

Status: Active » Needs review
Lal_’s picture

StatusFileSize
new14.27 KB
mglaman’s picture

Status: Needs review » Needs work

few changes

  1. +++ b/composer.json
    @@ -24,5 +24,10 @@
    +    },
    +    "extra": {
    +        "drupal-lenient": {
    +            "allowed-list": ["drupal/search_api_autocomplete"]
    +        }
    

    This should be removed, but a diff against composer.json is needed for DrupalCI to properly run against D10

  2. +++ b/js/search_api_autocomplete.js
    @@ -57,10 +57,9 @@
    +      $(once('search-api-autocomplete',
    +        '.ui-autocomplete-input[data-search-api-autocomplete-search]',
    +        context)).each(function () {
    

    once needs to be added to global scoping

  3. +++ b/search_api_autocomplete.info.yml
    @@ -3,8 +3,7 @@ description: "Adds autocomplete functionality to searches."
    -core_version_requirement: ^8 || ^9
    +core_version_requirement: ^8 || ^9 || ^10
    

    once requires 9.2

  4. +++ b/search_api_autocomplete.module
    @@ -121,8 +121,8 @@ function search_api_autocomplete_form_views_exposed_form_alter(array &$form, For
    +    /** @var \Drupal\views\Plugin\views\filter\FilterPluginBase $filter*/
    
    +++ b/src/Form/SearchEditForm.php
    @@ -9,6 +9,7 @@ use Drupal\Core\Entity\EntityForm;
    +use Drupal\search_api_autocomplete\Entity\Search;
    
    @@ -331,6 +332,8 @@ class SearchEditForm extends EntityForm {
    +    assert($this->entity instanceof Search);
    +    /** @var \Drupal\search_api_autocomplete\Entity\Search $search */
    

    unneeded

  5. +++ b/src/Plugin/search_api_autocomplete/suggester/Server.php
    @@ -185,7 +185,7 @@ class Server extends SuggesterPluginBase implements PluginFormInterface {
    -   * @return \Drupal\search_api_autocomplete\AutocompleteBackendInterface|null
    +   * @return \Drupal\search_api\Contrib\AutocompleteBackendInterface|null
    

    unneeded

  6. +++ b/tests/search_api_autocomplete_test/search_api_autocomplete_test.info.yml
    @@ -6,8 +6,7 @@ dependencies:
    -core_version_requirement: ^8 || ^9
    +core_version_requirement: ^8 || ^9 || ^10
    
    +++ b/tests/search_api_autocomplete_test_hooks/search_api_autocomplete_test_hooks.info.yml
    @@ -2,8 +2,7 @@ name: Search API Autocomplete Test Hooks
    -core_version_requirement: ^8 || ^9
    +core_version_requirement: ^8 || ^9 || ^10
    
    +++ b/tests/search_api_autocomplete_test_pages/search_api_autocomplete_test_pages.info.yml
    @@ -3,8 +3,7 @@ description: "Support module for testing integration of Search API Autocomplete
    -core_version_requirement: ^8 || ^9
    +core_version_requirement: ^8 || ^9 || ^10
    

    bump to 9.2 like parent

japerry made their first commit to this issue’s fork.

japerry’s picture

Status: Needs work » Needs review

Actually, test modules shouldn't have the `core_version_requirement` variable at all. Its annoying the schema validator doesn't get that. But these test modules shouldn't be in the Search package either. Updated the patch to incorporate that.

Opened a MR so we can test against Drupal 10 properly.

japerry’s picture

balintpekker made their first commit to this issue’s fork.

balintpekker’s picture

japerry’s picture

Status: Needs review » Reviewed & tested by the community

Manual testing of Search API Autocomplete worked properly w/o any errors reported on Drupal 10 beta.

However, tests are failing here because of upstream Search API errors. Marking RTBC because tests were passing locally for me when using the patch/MR from #3262092: Make search_api compatible with Drupal 10 -- And more importantly, its not throwing errors in Drupal 9, so this should be safe to commit in the interim to make compatibility with the other search api eco system modules work.. at least on head.

drunken monkey’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new3.27 KB
new14.35 KB

Thanks a lot for everyone’s work on this! Looks pretty good. I do have a few comments, though, see the MR. Attaching my suggested changes as a patch with interdiff, as I’m not used to working with MRs. Seems to me like this should also be enough to get this passing on Drupal 10, together with the Search API changes. (Bit of a chicken/egg situation.)

berdir’s picture

Test modules don't need a core version since 8.9 or so. There is a change record for that

  • drunken monkey committed 0f7a16f on 8.x-1.x
    Issue #3262214 by Lal_, japerry, balintpekker, drunken monkey, Berdir:...
drunken monkey’s picture

Status: Needs review » Fixed

Good to know, thanks a lot for the quick reply!
Removed those lines again and committed. Thanks again, everyone!

(Please re-open if you think any further changes I undid are needed/sensible.)

drunken monkey’s picture

Sorry, mglaman, forgot to credit you on the commit. My bad!

Status: Fixed » Closed (fixed)

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