How to convert existing taxonomy terms (to ucwords) with Termcase module? I'm using the Termcase module to make all the taxonomy terms ucwords in a specific vocabulary.



It also has the option: Convert the existing terms in this vocabulary immediately 

It works for making the term UPPERCASE, lowercase but doesn't work for ucwords although it has the ucwords (propercase) option (first character of each word uppercase).

And if needed this is the related code part in termcase.module:

case TERMCASE_PROPERCASE;
  $words = explode(' ', $original_string);
  foreach ($words as $key =&gt; $word) {
    $words[$key] = drupal_ucfirst($word);
  }
  $converted_string = implode(' ', $words);
  break;



What should I do to make all the existing terms ucwords?
Not a perfect solution but this is the way I used to solve the problem while converting terms to ucwords:

If all the letters of terms are lowercase then applying ucwords is working correctly.


Go to the vocabulary page you wanted to convert terms (admin/structure/taxonomy/VOCABULARY_NAME).
Select the "Convert all characters to lowercase" option.
Enable the "Convert the existing terms in this vocabulary immediately."
Save and then it will updates (converts) all the terms to lowercase.
Then select the "Convert the first character of each word to uppercase" option.
Save and then it will updates (converts) all the terms to ucwords.


Done.



original -> step 1-4 -> step 5-6


my first term -> my first term -> My First Term
MY SECOND TERM -> my second term -> My Second Term
My Third Term -> my third term -> My Third Term
mY FourTH TErm -> my fourth term -> My Fourth Term


It works correctly.





(If you directly apply "Convert the first character of each word to uppercase" option to these terms above, the results would become:

original -> ucwords


my first term -> My First Term
MY SECOND TERM -> MY SECOND TERM
My Third Term -> My Third Term
mY FourTH TErm -> MY FourTH TErm


Doesn't work correctly if the words has uppercase letters. So do as I mentioned above (steps 1-6).