Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The main functionality for supporting entity translations has been done in #2241429: Support translations, but it would be nice to have a setting in the content entity datasource to only include (or exclude) some languages.
Proposed resolution
Implement this setting and test it :)
Estimated Value and Story Points
This issue was identified as a Beta Blocker for Drupal 8. We sat down and figured out the value proposition and amount of work (story points) for this issue.
Value and Story points are in the scale of fibonacci. Our minimum is 1, our maximum is 21. The higher, the more value or work a certain issue has.
Value : 5
Story Points: 5
Comment | File | Size | Author |
---|---|---|---|
#27 | 2256219-27--datasource_language_options.patch | 14.59 KB | drunken monkey |
Comments
Comment #1
drunken monkeyClarifying the phrasing.
Also, we could probably even move this to the normal Search API issue queue, as this is really not of a high priority. Especially when we now want to encourage using a single index for everything, and when the Solr integration will hopefully support multilingual sites a lot better, I don't think this will be used much.
However, since I dropped the "Language filter" processor, this would otherwise be a regression, and I do think we want to avoid those.
Comment #2
drunken monkeyComment #3
Nick_vhComment #4
borisson_I think this is the right direction; needs more work though.
Comment #5
borisson_I've written a new test and that test fails, but I can't figure out what I should do to make it pass.
Comment #7
borisson_Tests still fail in all the same ways; but it now has less unused code.
Comment #8
borisson_Forgot the actual patch; woops.
Comment #10
borisson_I updated the patch and expanded the tests for this (in
IndexIntegrationTest
).The patch will still fail, but instead of 6 failing tests, locally this gives me 2.
CliTest
is still failing, as well as theIndexIntegrationTest
. I can't figure out why the tests are failing.Comment #11
drunken monkeyThanks a lot for the great patch!
On a first glance, this looks pretty good to me.
The test case could/should probably be merged with #2540668-11: Reindex misses translations, though, since they test a lot of the same stuff.
I also got the test failures (2 exceptions for
CliTest
, 2 fails for the newIndexIntegrationTest
). A bit too late to investigate today, though, maybe tomorrow.And, as usual, I also found a few smaller issues with the patch, see my attached revision.
Comment #13
borisson_This should fix the
IndexIntegrationTest
, no idea why theCliTest
is still failing.Comment #16
borisson_Comment #19
borisson_I can't seem to figure out why the patch in #16 is failing.
I agree with #11 that the new test here can be integrated in the new test in #2540668: Reindex misses translations. Do you want me to postpone this issue on that one?
Comment #20
borisson_Test should be green now.
Comment #21
drunken monkeyNo, I don't think that's necessary. We can just as well commit here and then add the tests from the other issue to this one. I renamed the test to
LanguageIntegrationTest
, in any case, so that will be a fit.Otherwise, the patch looks pretty good, nice work!
However, what confuses me is
ContentEntity::setConfiguration()
: there is a huge amount of code there to determine whether the selected bundles changed and, if they did, to change tracking accordingly. Isn't the same needed for the selected languages, too?And, if it is, it is of course worrying that the tests don't catch this bug. (But should only be a few lines to add to the test.)
Comment #24
drunken monkeyRe-rolling and fixing one stupid mistake.
Comment #27
drunken monkeyHuh. Somehow, this isn't going entirely in the direction I hoped it would …
But, interestingly, I just seem to have found a bug in a completely unrelated part of the code. Good to know!
Tests pass for me now locally, let's see whether the test bot agrees.
Comment #28
borisson_I'm pretty happy with the results here, when this patch applies I'll reroll #2540668: Reindex misses translations.
Comment #29
drunken monkeyOK, great! Committed.
Thanks again!