Problem/Motivation
On #2664830: Add search capability to help topics, andypost/ambermatz discovered that if you go to admin/search/pages and disable the Help Search page, then any page (such as admin/help) that is displaying the Help Search block will have a WSOD.
The reason is that the Search Block Form doesn't verify that the page it is supposed to submit to exists and is active. It should.
Proposed resolution
Alternative 1:
A patch was proposed by jhodgdon on #2664830-203: Add search capability to help topics -- here's the interdiff:
https://www.drupal.org/files/issues/2019-10-08/interdiff_13.txt
It needs a test. Also the part for the doc block in the interface is on another issue. Only the SearchBlockForm needs the patch.
Alternative 2:
Another way to resolve this would be to remove the ability to disable search pages. It is not clear why you would want to disable them anyway.
Remaining tasks
1. Decide which way to go -- the consensus is that we should remove the ability to disable search pages.
2. Make a patch.
User interface changes
The ability to disable search pages will not exist any more. You will only be able to add and delete pages, not disable them.
API changes
Functions related to disabling search pages and checking status will be removed/deprecated.
Data model changes
The status component of search page plugin configuration will be removed.
Release notes snippet
TBD
| Comment | File | Size | Author |
|---|---|---|---|
| #26 | interdiff_24-26.txt | 2.14 KB | meenakshi_j |
| #26 | 3086846-26.patch | 31.93 KB | meenakshi_j |
Comments
Comment #2
andypostLooks here's a caching issue, because right after index disabled the block is shown but not search page available (I'm using standard profile)
Comment #3
andypostAs I got working on #2901590-7: Investigate route rebuilding problem wrt Search module as that when search page enabled nothing calls route rebuild
Comment #4
jhodgdonI think that the right solution here is that we should remove the ability to disable search pages. I think they should either be there or be deleted. Having disabled search pages is just an extra layer of complication that the Search module doesn't need.
Will ask for comments in Slack/DrupalChat.
Comment #5
pwolanin commented+1 to removing the disable functionality and limiting to add/remove
Comment #6
jhodgdonIt seems like (from the chat discussions and from the Search maintainer) we have a consensus to remove the ability to disable search pages. Updating summary.
Comment #7
jhodgdonbetter title
Comment #9
andypostIt will deprecate some usage in 9.x for 10.0 removal
Comment #10
jhodgdonWe will also need to have an update function. I suppose it will need to delete any SearchPage config items that have status => FALSE?
Comment #11
andypostI think yes, we should delete them because otherwise enabling them could be more disruptive
Other thing is how to catch all usage of enable/disable which is scattered at all controllers...
Comment #12
jhodgdonIndeed. One way to find out what needs fixing might be to remove/deprecate the status fields/methods/properties/whatever from the plugin and config entity classes and schema, and see what breaks.
Comment #13
jhodgdonThis is interesting: The status flag is part of the config_entity base schema in core/config/schema/core.data_types.schema.yml, which the search page config schema inherits from. So I don't think we can get rid of it from the config schema. All we can do is ignore it, and remove it from the UI.
So. As a first pass at this, I've made a patch that overrides and deprecates the status methods for the search page config entity, and removes/fixes some other things that were testing/using status. Let's see what breaks!
We'll also still need an update and update test, which would remove any disabled search pages.
Comment #14
jhodgdonWeird automated test result. Oh, I think it's because 9.x wasn't working -- so I'll hit Retest.
Also one coding standards message to deal with once we see the test bot results:
Comment #15
jhodgdonHere's a second pass. Should fix a lot of the test fails.
Comment #16
xjmIn order to follow the continuous upgrade path, I think we need to deprecate the functionality in a minor release of D9. Then, it can be removed in 10.0.x. Thanks!
Comment #18
wim leersAs an alternative to this — here's a patch that just makes sure that
SearchBlockFormnever crashes: #3204343: Disabling the default search page can make the entire site inaccessible.Comment #19
ravi.shankar commentedRerolled patch #15 on Drupal 9.2.x
Comment #21
nikitagupta commentedRerolled patch #19 and fixed the failure.
Comment #22
nikitagupta commentedRerolled patch #21
Comment #24
meenakshi_j commentedComment #25
andypostshould be 9.3.0
Comment #26
meenakshi_j commentedComment #27
andypostInteresting, I think this operations should not be there.
OTOH if contrib will add them then it should not be unset here
Comment #30
aaronbaumanJumping in here with my use case, which I fear will be exacerbated by this change:
* Have a site with many nodes (1M+), only a small fraction of which I want to be searchable
* Install search_exclude module to create a search page meeting that criteria
* Default search is still enabled, so search tables in database still grow insanely large
How can I address this concern if the default search is forever enabled, and millions of nodes are getting indexed?
Comment #32
smustgrave commentedFrom what I can see #10 still needs to be addressed.
Did not review code.
Comment #35
quietone commentedThe Search Module was approved for removal in #3476883: [Policy, no patch] Move Search module to contrib .
This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
The deprecation work is in #3565780: [meta] Tasks to deprecate the Search module and the removal work in #3565783: [meta] Tasks to remove the Search module.
Search will be moved to a contributed project before Drupal 12.0.0 is released.