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'])) {

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

henryhu created an issue. See original summary.

pashupathi nath gajawada’s picture

Assigned: Unassigned » pashupathi nath gajawada
pashupathi nath gajawada’s picture

Status: Active » Needs review
Issue tags: +taxonomy, +drupal core
FileSize
756 bytes

Please find the attached patch which fixes this.

Status: Needs review » Needs work

The last submitted patch, 3: mixed_case_dumped-2644276-3.patch, failed testing.

pashupathi nath gajawada’s picture

Status: Needs work » Needs review

Version: 7.41 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

poker10’s picture

Yes, 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.

The last submitted patch, 7: 2644276-7_test-only.patch, failed testing. View results

The last submitted patch, 9: 2644276-9_test-only.patch, failed testing. View results

mcdruid’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +RTBM

Again, the test that @poker10 added makes this easy to commit.

Thanks!

  • poker10 committed e354dcb on 7.x
    Issue #2644276 by poker10, pashupathi nath gajawada, henryhu: Mixed case...
poker10’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -RTBM

Thanks all!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.