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.
1. Enable locale and testing module
2. Add a second language
3. Try to to run any tests
You'll get fatal errors about simpletest24353_languages doesn't exist. This is because drupal_multilingual in boostrap.inc doesn't get reset when tests start since it doesn't use drupal_static.
Comment | File | Size | Author |
---|---|---|---|
#5 | drupal-multilingual-710860-5.patch | 688 bytes | plach |
#1 | 710860-drupal-multilingual-static-reset-D7.patch | 652 bytes | Dave Reid |
Comments
Comment #1
Dave ReidPatch attached that fixes running tests when the host system has more than one language enabled.
Comment #2
rfayThis looks obvious to me and a no-brainer.
Read the patch. Looks good.
I tested and got the failure.
Applied the patch and fixed the failure.
IMO, it's good to go. It passes the bot. It's so simple and it's also best practice, so I'm setting to RTBC. If anybody disagrees or you think more opinions are needed, then reset it.
Comment #3
plachIMO we can simply drop the static caching: having a function call to cache another function call, both of which are more or less equal in terms of cpu usage, makes no sense.
I had this need also in #632172-6: Node language and field languages may differ and following.
Comment #4
catchYes, agreed with #3, drupal_static() may even be slower than variable_get().
Comment #5
plachThis one implements #3.
Comment #6
plachSorry, didn't notice the issue was assigned to Dave Reid.
Comment #7
Dave ReidGood enough for me. Either one works.
Comment #8
plachChanging the issue title accordingly.
Comment #9
plachtagging
Comment #10
webchickNice! This bug has long haunted the testing framework. Glad to see it put to rest. I'd mark it "Needs tests" but I don't think we have a reliable way of testing the testing system. ;P
Committed to HEAD!
Comment #11
Dave Reid@webchick @platch Yippee! Thanks!