Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
views.module
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Dec 2014 at 11:08 UTC
Updated:
21 Jan 2015 at 23:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
gábor hojtsyDoes that have a failing test? If yeah it may be easier to fix it there. It may be more painful to provide a standalone test here.
Comment #2
wim leersYes, it caused a failed test, that's how it was discovered
Comment #3
gábor hojtsyRight, it may be simpler to fix it there? No need for one more explicit test then?
Comment #4
wim leersIf you want to reroll the patch there to include that change, that's fine by me :)
Comment #5
gábor hojtsySo we can postpone on #2372855: Add content & config entity dependencies to views and just update that config.
Comment #6
effulgentsia commented#2372855: Add content & config entity dependencies to views is fixed, so unpostponing this one.
Comment #7
xjmComment #8
xjmThis also could probably be a novice issue!
Comment #9
gábor hojtsyWhere the schema is incorrect, it will be a D8 upgrade path issue because we would need to write an update function for updating the config structure to the new correct expectation. At that point I am not sure this would be a novice.
Additionally to the incorrect value type on views.filter.taxonomy_index_tid (inherited from views.filter.many_to_one), the definition of views.filter.taxonomy_index_tid_depth was entirely incorrect. It inherits from views.filter.taxonomy_index_tid on the PHP side (class TaxonomyIndexTidDepth extends TaxonomyIndexTid) so should on the schema side. Then all the duplicate keys should be removed (including values). The only new field is depth. See TaxonomyIndexTidDepth::defineOptions().
Comment #10
dawehnerLooks fine for me.
Comment #12
gábor hojtsySo this is a WAY bigger mess than expected. The problem is as follows:
1. views_filter defines a value key as a dynamic type based on the filter's plugin_id:
So all types extending from views_filter theoretically need to define their own value via subtyping in the
views.filter_value.Xnamespace. Here are some:That is all good, and these are actually single value filter types. BUT then there are multivalue field types, chiefly InOperator and its extension ManyToOne. The config schema for those defined the value as a sequence of strings.
Due to how this is deepmerged, the sequence typing overrides the original dynamic type so all in_operator inheritors (such as many to one, taxonomy index tid, etc) take the string sequence instead of the dynamic type.
Now we naturally want to override that in
views.filter.taxonomy_index_tidwhich turns out to be impossible. Why? If you look into TypedConfigManager::getDefinition(), the definition is merged in with the parent, giving the child precedent but NestedArray::mergeDeep() is used, which accumulates numerically indexed array items instead of replacing them with each other. Configuration schema uses numerically indexed items for typing only for sequences. It is a bit of an odd use of a list because it can only ever have one item, but well, that is how it is now. We could change that and incur the API change across all schemas or we need to fix the merging to not accumulate array items (having second and third type definitions for the sequence) but to overwrite it, so our type definition for the taxonomy item will prevail.Definitely not novice and at least a major.
Additionally to the PHP bugfix, removing the elements from many_to_one that are already inherited and removing a never ever used views.filter_value.language since the parent filter definition is an in_operator, so as discussed above, the dynamic views.filter_value.language value would never be consulted anyway. (Its also incorrect, the in_operator is multivalued not single valued).
Updated issue summary and added beta evaluation as well.
Comment #13
vijaycs85Looks good.
another cleanup?
left over removal++
Comment #14
alexpottCommitted a542a43 and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation.