Problem/Motivation
The configuration of Facet source current does not have a dependency on the source configuration. This creates an issue when configuration is split over different sync directories in a multsite setup, for example using the Config Split contributed module.
Assume a configured view 'Search' with a display 'Page'. The exported facet source configuration then looks like this:
uuid: 5c5f91a8-1047-44a2-8213-6fa44a691a5f
langcode: en
status: true
dependencies: { }
id: search_api__views_page__search__page
name: 'search_api:views_page__search__page'
filter_key: null
url_processor: query_string
breadcrumb: { }
Proposed resolution
Add a dependency on the source configuration, so the exported configuration looks like this:
uuid: 5c5f91a8-1047-44a2-8213-6fa44a691a5f
langcode: en
status: true
dependencies:
config:
- search_api.index.default
- views.view.search_page
id: search_api__views_page__search__page
name: 'search_api:views_page__search__page'
filter_key: null
url_processor: query_string
breadcrumb: { }
As a result, exporting a view to a split configuration directory correctly moves the facet source configuration to the target directory.
Remaining tasks
- Write a patch
- Review
- Commit
User interface changes
None.
API changes
None.
Data model changes
The exported configuration files have a new dependency on source configuration.
Comment | File | Size | Author |
---|---|---|---|
#11 | 2927098.patch | 2.87 KB | borisson_ |
Comments
Comment #2
borisson_You are right, this is correct. I tried fixing this but I don't know how.
Comment #3
borisson_In theory, this should be enough, I think.
Comment #5
borisson_Should fix that test.
Comment #6
idebr CreditAttribution: idebr as a volunteer commentedAn example of the current dependency chain is 'Facet: field_tags' -> 'Facet source: View Search content, display Page' -> 'View: Search, display page'. The current patch adds a dependency the wrong way: from facet source to the facet.
Comment #7
idebr CreditAttribution: idebr as a volunteer commentedComment #8
andypostI think only view should be added to dependency which in turn will provide dependency on index
Comment #9
borisson_Well, we can also have Search API pages as a source, instead of a view, we also have the core search facets that provide a facetsource with core search.
So just adding this to view doesn't seem like that would be easy to do. I'm not sure how we should do this instead though.
Comment #10
borisson_Comment #11
borisson_I think this is a good start.
Comment #12
borisson_Needs work, the tests should be fixed, probably by checking if the plugin exists before creating an instance of it.