Closed (fixed)
Project:
Facets
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Jan 2016 at 11:42 UTC
Updated:
5 Feb 2016 at 11:44 UTC
Jump to comment: Most recent, Most recent file
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/removeProcessormethod 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 commentedComment #4
borisson_We have to be careful not to do this for
$url->setOptioncalls, those are not related to what we're trying to achieve.Comment #5
christianadamski commentedUpdated list.
Comment #6
christianadamski commentedempty_behavior is stored but not defined in schema
Comment #7
christianadamski 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 commentedComment #11
christianadamski 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 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 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_