Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The configuration inspector reports an issue with the stored facet schemas.
There is an "options" key in the schema that should not be there. The key itself contains some other keys that should be higher in the yaml file hierarchy.
Actual report:
options Undefined undefined missing schema
Local Example:
uuid: ###
langcode: de
status: true
dependencies: { }
id: user_search_city
name: 'User Search - City'
url_alias: city
field_identifier: combine
query_type_name: null
facet_source_id: 'core_views:search_users_v1:search_page'
widget: links
widget_configs:
show_numbers: '1'
options:
processors:
core_views_exposed_filter_url:
processor_id: core_views_exposed_filter_url
weights: { }
settings: { }
count_widget_order:
processor_id: count_widget_order
weights: { }
settings:
sort: DESC
empty_behavior:
behavior: none
only_visible_when_facet_source_is_visible: true
Comment | File | Size | Author |
---|---|---|---|
#19 | clean_up_facet_schema-2645128-18.patch | 26.59 KB | borisson_ |
#19 | interdiff.txt | 1.13 KB | borisson_ |
Comments
Comment #2
borisson_So this issue needs to do work related to for #2638116: Clean up caching of Index class method results (especially fields) - in the search Api queue.
We want to do a couple of things to make this better:
[g|s]etOption(s)
from the facet class / interface.addProcessor
/removeProcessor
method to the facet class / interface and use those instead of the options to set the processors.This is probably a good start.
Comment #3
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer commentedComment #4
borisson_We have to be careful not to do this for
$url->setOption
calls, those are not related to what we're trying to achieve.Comment #5
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer commentedUpdated list.
Comment #6
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer commentedempty_behavior is stored but not defined in schema
Comment #7
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer commentedThere are quite a number of
or
which are at least in some cases simply stored/called by
I would be in favour of removing one-line getters/setters.
Comment #8
borisson_I think we should keep the one-line getters / setters and remove the
$facet->set('setting', $value);
versions of them. If we ever want to include some kind of validation of reactions / caching, these getters/setters will come in handy.Comment #9
borisson_Regarding #6. We should probably save the empty_behavior in a new setting as well. This used to be a plugin and it no longer is, so we can probably clean this up to be a flatter config object.
Comment #10
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer commentedComment #11
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer commentedI got most of this I think. Still left to do:
- clean up tests
- figure out a sane consistent way, to tell if a processor is enabled
- at some point: add a new test
- hook up the url processor changes to "my" views_facets code. I use that for testing.
Comment #12
borisson_Awesome, can you post a patch so I can take a look at how you solved this?
Comment #13
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer commentedPatch attached. It should handles what is described here and also #2640990.
It works fine here and passes tests. Doesn't say much though.
Comment #15
borisson_Test don't actually pass, code looks great at first glance, will have another look later today / tomorrow morning.
Comment #16
borisson_Sorry for taking so long to respond. I found a couple of small remarks but this looks great. When tests are green again we can commit this.
If this is really just an array of strings, the annotation should be
@var string[]
Is this the plugin or the config? We should add this in as a comment as well.
All the changes in the Interface should have at least a one-line documentation as well as a description for the variable to stay within the drupal documentation standards.
Nice! This looks better.
Comment #17
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer commented1.) facet_configs:
type: sequence
label: 'Facet plugin-specific options'
sequence:
type: plugin.plugin_configuration.facets_facet_options.[%key]
label: 'Facet plugin options'
So it's acutally an array arrays. Does that indiate "array[]"?
2.) empty_behavior:
type: mapping
label: 'Empty behavior'
mapping:
behavior:
type: string
label: 'The empty behavior identifier'
text_format:
type: string
label: 'Text format'
text:
type: string
label: 'Text'
I just concluded this from the code. So I guess string[] would be correct here? Added that.
3.) Added comments at some places.
=> Tests failing. Do I have to fix that? Having issues with testing for unrelated reasons here.
Comment #19
borisson_I don't think that's used, we can use
string[][]
though.Yep that looks correct.
The tests are related. I just ran a new branch test and that's green: https://www.drupal.org/pift-ci-job/135470
I attached a patch that should fix the tests.
As a sidenote, it would be awesome if you could provide an interdiff for patches.
Comment #21
borisson_Committed, thanks again for your work.
Comment #25
borisson_