#2650986: Fix entity loading in SearchApiFieldTrait improved, and finally fixed a lot of things about, retrieval of property values for Views.
Howeve, I failed to take into account one special case: when the search backend (e.g., Solr – or, some other part of the search, really) passes field values to Views, this doesn't work correctly anymore when the field is a configurable processor-generated field. The field will be extracted again via the processor, but then neither those values nor those from the backend will actually be used.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 2911734-5--fix_views_processor_fields_extraction.patch | 11.87 KB | drunken monkey |
| #5 | 2911734-5--fix_views_processor_fields_extraction--tests_only.patch | 7.65 KB | drunken monkey |
Comments
Comment #2
drunken monkeyI think this quick workaround should at least make the view use the correct values from the backend, even though they will also be extracted again via the processor needlessly. (It also messes up the
ResultRowobject even more, so I want an entirely different solution eventually.)Comment #3
drunken monkeySee also: #2911836: Fix object retrieval in Views for "Link to item", which plays into this.
Comment #4
drunken monkeyOK, I think this is a quite simple, but not too hack-y solution for this. It could probably use some test coverage – but first, it would be great if someone could test it.
Comment #5
drunken monkeyOK, managed to get together a complete test of Views field extraction.
Unfortunately, it doesn't fail without the fix in here (probably because the essential part is in the query plugin), but I think the tests are still great to have. (The tests-only patch doubles as the interdiff.)
Comment #6
borisson_This looks good from a first glance but haven't manually tested it.
Comment #7
drunken monkeyComment #8
mkalkbrennerI tested the code with the Vienna 2017 demo. It works :-)
Comment #10
drunken monkeyThanks for both of your reviews! Good to hear it looks good.
Committed.
Comment #11
drunken monkeyComment #13
drunken monkeyWould have been too nice, I guess … It seems this was never really working 100%. See #3031621: rendered_item|rendered_item in results of SearchApiQuery.php, and please help me fixing it there by testing/reviewing! Would be very interested to hear what you think.