Closed (fixed)
Project:
Search API
Version:
8.x-1.x-dev
Component:
Plugins
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Aug 2015 at 08:28 UTC
Updated:
6 Oct 2015 at 12:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
christianadamski commentedHere is the patch. Instead of casting to string, I use the __toString(). Not sure if there is actually any difference or preference to that.
Comment #4
christianadamski commentedRerolling. Went back to directly casting to (string) and instead checking for FALSE/empty.
Comment #6
christianadamski commentedFor the tests to succeed, patch in #2473717: Add support for per-bundle view modes in the rendered entity processor is required as well.
Comment #8
drunken monkeyLooks good, thanks!
Could you maybe also add a test for this to the
RenderedItemTestclass? A small type check intestPreprocessIndexItems()should suffice.What do you mean with that? Does it prevent the nodes from being indexed, or the index from being saved, or … ? And where does it actually fail?
Comment #9
christianadamski commentedAt least for us here, saving any node actually resulted in a PHP-Error, because Unicode::truncateBytes or something like that failed hard. Expected a string and got an object.
The reason this isn't triggered in the test, is that the viewmodes that should be set up in the config used in the Test are not used. Therefore preprocess() skips the critical parts in code.
I'm looking into this.
Comment #10
christianadamski commentedThe issue I described actually does not occure during the preprocessing, but during indexing. There the SafeString value is used that was set during preprocessing.
I'll attach a patch that simply calls for indexItems at the end of the preproccess test. At least locally here, this causes the tests not only to fail, but to get stuck. I do not know enough about the Test Framework to proceed here. I do not know how to handle the testing itself failing.
Comment #11
christianadamski commentedOkay, so that actually causes a completely different error that is most likely caused by calling indexItems in an incorrect way.
I don't know enough here. To correctly cover this issue in a test, you would have to make sure, that preprocessed items later can be correctly indexed as well. So you would need to have a test that does both, using a processor to handle items and than trigger the indexing.
I did not find a test doing that to copy from :(
Comment #12
drunken monkeyLet's try it like this …
Comment #15
drunken monkeySplit the
IntegrationTestchanges into #2564853: Test enabling all processors and indexing.Comment #16
drunken monkeyCommitted.
Thanks again!