Problem/Motivation

Track the steps needed to deprecate extension Search. See Remove a core extension and move it to a contributed project of the deprecation policy.

The removal of extension Search was approved in #3476883: [Policy, no patch] Move Search module to contrib.

Remaining tasks

The issue to remove Search has an MR and can help find what needs to be changed to deprecate Search. #3586217: Remove the Search module

  1. ✅Find someone to maintain the contrib version. @xmacinfo has agreed to maintain. see #36
  2. ✅Add the extension to the list of the Upcoming Deprecations.
  3. Move integrations implemented by other modules to the extension.
    Create child issues or child meta issues, as needed, to address the following points. Not all points will apply to all extensions.
  4. ✅Do a thorough search of core for any remaining references to the extension. If references are found, outside of the extension, then create issues to remove the references.
  5. ✅Create the contrib Search project with a stable release, before the alpha version of the major release. Follow the process in Create the contrib project with a stable release for creating the sub tree split.
  6. ✅Deprecate the core extension. #3565781: Deprecate the Search module
  7. ✅Open an issue, 'Ensure that Search module does not get special core treatment' in the packages.drupal.org issue queue to ensure that the composer namespace for the contributed project matches the core one after removal. This is to allocate the drupal/search Composer namespace to contrib extension rather than the core extension.
  8. ✅Update the Deprecated and obsolete extensions

Comments

quietone created an issue. See original summary.

quietone’s picture

Issue summary: View changes
quietone’s picture

Issue summary: View changes
quietone’s picture

These tests install Search

  • core/modules/block/tests/src/Functional/BlockHiddenRegionTest.php
  • core/modules/help/tests/src/Functional/HelpTopicSearchTest.php
  • core/modules/help/tests/src/Kernel/HelpSearchPluginTest.php
  • core/modules/jsonapi/tests/src/Functional/SearchPageTest.php
  • core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php
  • core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php
  • core/modules/node/tests/src/Functional/NodeTranslationUITest.php
  • core/modules/page_cache/tests/src/Functional/PageCacheTagsIntegrationTest.php
  • core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php
  • core/modules/system/tests/modules/form_test/src/Form/FormTestLabelForm.php
  • core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php
  • core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
  • core/modules/user/tests/src/Functional/UserSearchTest.php
  • core/modules/views/tests/src/Functional/DefaultViewsTest.php
  • core/modules/views/tests/src/Functional/SearchIntegrationTest.php
  • core/modules/views/tests/src/Functional/SearchMultilingualTest.php
  • core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php
  • core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormCacheTest.php
  • core/tests/Drupal/FunctionalTests/Theme/OliveroTest.php
  • core/tests/Drupal/FunctionalTests/Theme/OliveroTest.php
  • core/tests/Drupal/KernelTests/Core/Recipe/RecipeTest.php
quietone’s picture

Issue summary: View changes

Talked to catch about about skipping handling the migration tests due to the fact the Migrate Drupal and family is being removed and not ported to contrib and that the migrations in Search are all configuration migrations. We both agreed that it OK in this case. I have updated the issue summary accordingly.

quietone’s picture

Issue summary: View changes
quietone’s picture

Issue summary: View changes

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

quietone’s picture

Issue summary: View changes
smustgrave’s picture

Just noting that there is some config in the node module for search.

quietone’s picture

Issue summary: View changes

Yes, search is in lots of places. Support for search is in: claro, default_admin, demo_umami, starterkit, and olivero. Also theme.api.php and entity.api.php. And comment module.

quietone’s picture

quietone’s picture

I think these are the config that need to be handled.

  • core/modules/node/config/install/core.entity_view_mode.node.search_index.yml
  • core/modules/node/config/install/core.entity_view_mode.node.search_result.yml
  • core/modules/node/config/optional/search.page.node_search.yml
  • core/modules/node/config/schema/node.schema.yml
  • core/modules/user/config/optional/search.page.user_search.yml
  • core/modules/user/config/schema/user.schema.yml
kentr’s picture

Olivero has some libraries related to Search.

quietone’s picture

Issue summary: View changes
quietone’s picture

Issue summary: View changes
quietone’s picture

Issue summary: View changes
quietone’s picture

Issue summary: View changes
quietone’s picture

Issue summary: View changes
quietone’s picture

Issue summary: View changes
quietone’s picture

Issue summary: View changes
quietone’s picture

Issue summary: View changes
quietone’s picture

Search core for usages of the Search module is difficult because 'search' is also used in database code and view for example.

For themes alone there are 321 uses of the word search.

$ git grep search | grep core/themes | wc -l
321

quietone’s picture

Issue summary: View changes
quietone’s picture

Issue summary: View changes
joachim’s picture

There is material on search in various api.php files:

- entity.api.php
- hook_menu_links_discovered_alter sample code
- theme.api.php " * preprocessing functions. For example, the core Search module defines a theme" (and LOADS more)
- node.api.php
- toolbar.api.php

gábor hojtsy’s picture

Issue summary: View changes
gábor hojtsy’s picture

Issue summary: View changes
quietone’s picture

Issue summary: View changes

The issue to remove Search has an MR and can help find what needs to be changed to deprecate Search. #3586217: Remove the Search module

quietone’s picture

Issue summary: View changes
quietone’s picture

The removal issue has test failures #3586217: Remove the Search module that need to be handled. For example, core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php needs the Search module.

quietone’s picture

Olivero has search blocks, block.block.olivero_search_form_narrow.yml and block.block.olivero_search_form_wide.yml

core/tests/Drupal/KernelTests/Core/Database/SelectExtenderTest.php and core/tests/Drupal/Tests/Core/Database/ConnectionTest.php use \Drupal\search\SearchQuery

quietone’s picture

These tests fail because Olilvero has optional config of search blocks

  • core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php
  • core/tests/Drupal/FunctionalTests/Theme/OliveroTest.php
quietone’s picture

git grep for search is finding uses in starterkit_theme and in the following

  • core/tests/fixtures/config_install/multilingual/core.entity_view_mode.node.search_index.yml:id: node.search_index
  • core/tests/fixtures/config_install/multilingual/core.entity_view_mode.node.search_result.yml:id: node.search_result
  • core/tests/fixtures/config_install/testing_config_install/core.entity_view_mode.node.search_index.yml:id: node.search_index
  • core/tests/fixtures/config_install/testing_config_install/core.entity_view_mode.node.search_result.yml:id: node.search_result
quietone’s picture

I was just looking for the contrib project and I can't find one. Then I realized that no one has offered to maintain the contrib version, at least not in this issue. That is a big mistake.

xmacinfo’s picture

I can maintain it if no one picks it up.

quietone’s picture

Issue summary: View changes
quietone’s picture

Issue summary: View changes

@xmacinfo, thanks. That is great news! The place to start is item 5 in the Remaining Tasks. If you have further questions, asking in #core-development would be best. There are people there who have gone through the process and can assist if needed.

smustgrave’s picture

Don’t want to be a maintainer but @xmacinfo feel free to ping if you have any questions! Thanks for volunteering

xmacinfo’s picture

I will start the process today.

xmacinfo’s picture

The search project short name is reserved.

I opened a ticket in Gitlab infrastructure issue queue.

xmacinfo’s picture

xmacinfo’s picture

Infrastructure confirms that once we give a module a machine name, we cannot change it afterwards. So a temporary machine name for Search is out of the question.

It may be possible to own the reserved search machine name, but infra highlighted some rough steps to reach that goal. I will need your help assisting infra on this.

The other solution is to host the Search code under a new machine name (not the reserved search name).

In summary:

- We can try to get search machine name, where we may need some additional help in the infra ticket.
- We may choose to use another machine name and close the infra issue.

What are your point of view?

quietone’s picture

What I hope is the last issue blocking deprecation has been committed.

catch’s picture

@xmacinfo can you link to the infra issue you opened? It's not clear to me whether this is a 'normal' level of friction getting the contrib namespace or whether there's an extra problem with search specifically.

quietone’s picture

Issue summary: View changes
catch’s picture

quietone’s picture

Issue summary: View changes
quietone’s picture

@xmacinfo, You can now create the contrib version, the project has been created with you as a maintainer, https://www.drupal.org/project/search

xmacinfo’s picture

Assigned: Unassigned » xmacinfo
quietone’s picture

Issue summary: View changes

Add link to contrib project

quietone’s picture

@xmacinfo, How is it going with making a stable contrib release for search? It is urgent that we have a stable release. Would you like some assistance?

xmacinfo’s picture

@quietone: Yes, some assistance would be appreciated.

I am currently stuck on a movie set and I will not be able to generate the initial release of Search before four days.

gábor hojtsy’s picture

I'll try to help you out here in the interest of unblocking core using the steps on https://www.drupal.org/about/core/policies/core-change-policies/how-to-d...

quietone’s picture

@xmacinfo, thanks for letting us know. And to @gábor hojtsy for taking the next steps.

gábor hojtsy’s picture

Instructions resulted in a somewhat messy repo with most commits with today's date due to the rebase. Figured out a way around it, history now here with proper committers and dates: https://git.drupalcode.org/project/search/-/commits/1.x?ref_type=HEADS

First CI run ran into this naming conflict with core, how is this usually resolved? Does it require a core change?

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - drupal/search is present at version 1.x-dev and cannot be modified by Composer
    - Root composer.json requires drupal/core-recommended 11.4.6 -> satisfiable by drupal/core-recommended[11.4.6].
    - drupal/core-recommended 11.4.6 requires drupal/core 11.4.6 -> satisfiable by drupal/core[11.4.6].
    - drupal/core[11.4.6] cannot be installed as that would require removing drupal/search[1.x-dev]. drupal/core replaces drupal/search and thus cannot coexist with it.
catch’s picture

11.4 intentionally replaces drupal/search so that 11.4 sites don't suddenly install the contrib module as soon as there's a release.

However we should remove it from replace in 11.x, probably in the search removal issue, so that sites can install it on 11.5.0 (it's not in main's replace section already).

More details about this in #3616593: Add all modules & themes to the composer replace section

quietone’s picture

Assigned: xmacinfo » Unassigned
Issue summary: View changes
Status: Active » Fixed

There is a stable release, which I was able to get using composer, although it is not yet shown on the Search project page.

Thanks everyone for getting this done!!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

xmacinfo’s picture

Thank you to everyone who pitched in.

xmacinfo’s picture

Is there a way to migrate all Search issues to the new Search project?

smustgrave’s picture

If the contrib module is not migrated to gitlab yet you can go into the issue and change the project.

If it has I think drumm may be able to help

smustgrave’s picture

May have found an interesting bug. I went to the project page and clicked issues and it took me to https://www.drupal.org/project/issues/search which shows me all issues in Drupal.

quietone’s picture

@xmacinfo, I can handle getting the issues moved.

gábor hojtsy’s picture

@xmacinfo: once the issues are moved to gitlab (which should be soon after they are moved out of core), the bug with d.o integration will not be relevant anymore :)

xmacinfo’s picture

Cross-posted!

@quietone Please do. Does the process involves migrating the Search issues to Gitlab?

I confirm seeing the issues when clicking, while the project pages issues count is “0”.

quietone’s picture

The infrastructure team in not migrating any extension that has the same namespace as a core module. This means the contrib Search project is on d.o and I can triage the queue and move issues as we have always done. Once that is complete you should be able to coordinate with the infrastructure team to have the project migrated to GitLab. One way to know if the issues are moved is to follow the removal meta issue, #3565783: [meta] Tasks to remove the Search module. Moving issues and documentation is part of that issue.