Closed (fixed)
Project:
Search API
Version:
8.x-1.x-dev
Component:
Framework
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Jan 2016 at 11:40 UTC
Updated:
19 Jul 2016 at 08:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
drunken monkeyComment #3
Saphyel commentedComment #4
Saphyel commentedComment #7
drunken monkeyThanks for your work!
There are some issues with your patch, though:
I would return early in case the first check works out. Also, you should only check the fallback type if
!$type->isDefault().Mostly, though,
$typeis a string at this point. You'll first need to load the appropriate data type plugin for this to work.The condition already produces a boolean, the trinary operator serves no purpose there.
What is this change?
Might be the reason the patch fails to apply.
Also, if we fix this, we can remove the
@todocomment in that method. (Speaking of which – that comment moved yesterday, so maybe that's the reason the patch won't apply. Please use the very latest dev version!)Comment #8
Saphyel commentedI think I used the lastest dev version, git at least says the commit id 270a742918a02fd86808757af551a64a1af2e1c4 from yesterday.
I don't understand your 3rd point, maybe your browser show you something wrong ? My patch doesn't change that line and the comments are still there...
Comment #9
Saphyel commentedSorry wrong patch :(
Comment #12
ndrake86 commentedFirst attempt at address #1 in comment #7 with isTextType expecting a FieldInterface instead of as string.
Probably a much easier way but thought I would give it a shot.
Comment #15
ndrake86 commentedSecond go at this. Handling special fields problem.
Comment #16
ndrake86 commentedComment #19
ndrake86 commentedI think I went the completely wrong direction with what I was trying to accomplish. I think this is a better patch.
Comment #22
drunken monkeyYes, this looks a lot better, thanks a lot!
Except that you can just use
$manager->createInstance()instead of iterating over all instances (which we might want to override to add caching, come to think of it) this already looks like the correct solution. We'll just have to fix the test cases to add a mockup of the plugin manager in a container. (See, e.g., ourEntitySerializationTestfor an example of adding mockup services.)Comment #23
ndrake86 commented@druken monkey, updated patch per your comment in #22.
Thanks for the reply and hopefully this helps.
Comment #26
ndrake86 commentedFailed cause of null $data_type. Don't quite know where that is possible but added isset check before that operation.
Comment #27
ndrake86 commentedComment #30
drunken monkeyThanks, great work!
I just reformatted according to my preferences, but your version was completely correct. Thanks again!
The attached patch also contains the discussed caching and should fix the reported test fails. (I get some more fails now, but want to make sure the test bot sees them, too, before working on them.)
Comment #32
drunken monkeyComment #33
drunken monkeyI'm not very good at this.
Comment #34
ndrake86 commented@drunken monkey I will pull the patch and test it out. Thanks for getting this all in.
Comment #35
ndrake86 commented@Drunken Monkey. Tested with a custom field type and everything is working from what I have tested.
Thanks,
Nick
Comment #36
borisson_Comment #38
drunken monkeyCommitted.
Thanks again for your work on this, everyone!