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.
Using taxonomy_get_term_by_name() to get a term. The term will be filtered out if it includes Chinese characters and mixed case of English, such as "Web开发". Checking taxonomy.module, it seems a typo in line 1275:
if (isset($conditions['name']) && drupal_strtolower($conditions['name'] != drupal_strtolower($term_values['name']))) {
I guess it was supposed to be this:
if (isset($conditions['name']) && drupal_strtolower($conditions['name']) != drupal_strtolower($term_values['name'])) {
Comments
Comment #2
pashupathi nath gajawada CreditAttribution: pashupathi nath gajawada as a volunteer and at Melity commentedComment #3
pashupathi nath gajawada CreditAttribution: pashupathi nath gajawada as a volunteer and at Melity commentedPlease find the attached patch which fixes this.
Comment #5
pashupathi nath gajawada CreditAttribution: pashupathi nath gajawada as a volunteer and at Melity commentedComment #7
poker10 CreditAttribution: poker10 at ActivIT s.r.o. commentedYes, it seems like there is a typo causing that each term which has mixed case letters is not loaded from the internal entity cache, instead is unset from the
$terms
array and loaded from the database.I have created a test to demonstrate this issue. Also attached the rerolled patch from #3, which should fix this problem. Let's check the testbot.
Comment #9
poker10 CreditAttribution: poker10 at ActivIT s.r.o. commentedI put an unnecessary override of
cacheGet()
method in theTestTaxonomyTermController
class. Reuploading the patch with this fixed.Comment #11
mcdruidAgain, the test that @poker10 added makes this easy to commit.
Thanks!
Comment #13
poker10 CreditAttribution: poker10 at ActivIT s.r.o. commentedThanks all!