Closed (fixed)
Project:
Language Hierarchy
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Oct 2015 at 11:14 UTC
Updated:
12 Nov 2015 at 11:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
james.williamsPatch followed :-) Hopefully there are enough comments in this to make it clear what is going on! From the Doxygen:
Comment #3
james.williamsComment #4
steven jones commentedWe really need some tests to cover that complicated code :)
Comment #5
steven jones commentedAdding a tag so someone at ComputerMinds can pick this up.
Comment #6
steven jones commentedGoing to look into writing a test for this one.
Comment #7
james.williamsTwo points of note, from a real-world discussion:
* entity_language() is not used for the final fallback case, which means different behaviour when there is a form language (with entity translation). Is that correct?
* It's actually possible for that final fallback, entity_language(), to return a language that there are not values for, since that might just return the site default language. So we should probably do a final fallback that loops through any remaining languages that haven't been checked, in weight order, until a value is actually found.
* It might even be worth doing an early quick edge case test, if there are no values in any languages, or just one, before the main bulk of the code tries to proceed.
Comment #8
james.williamsThis won't matter either way, as form language won't interfere at the point when it gets used. I could believe there is some obscure case when it does matter, but I think let's go with the simpler
My mistake, the patch does do this already.
This point would still be valid.
Comment #9
steven jones commentedRight, here's a patch that adds some tests. They need work, and review and probably re-working a little bit. But marking as needs review so that the testbot can have a play.
The gist is that we setup a field that will replace the entity label, and then view the node in various languages and assert that the field value for just that field falls back correctly, as we want to me much more permissive with that one than the others.
I've not implemented @james.williams suggestions from #8 and we should.
Comment #11
steven jones commentedImproved patch and added the quick check the alter for a single language to 'fallback' to.
Comment #12
steven jones commentedHere is the latest work in progress.
Comment #14
steven jones commentedBetter tests, that work, and actually test things.
Reckon this is good for commit now.
Comment #16
steven jones commentedYeah, so the testbot totally didn't download the title module :(
Comment #17
james.williamsNew test dependencies don't work nicely with testbot, so let's commit the patch and then run the test again just to confirm it really was that. Looks fine to me otherwise, thanks Steven.
Comment #23
steven jones commentedHopefully this is fixed and the branch tests will pass.
Comment #25
steven jones commentedStop it testbot!
Comment #26
steven jones commentedFor clarity, the testbot now says that this branch passes.