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
When the bulk status check iterates through locales and compares them against the smartling_locales_convert_array
variable, the casing doesn't match and locales such as "es-LA" are skipped because the value stored in the variable is "es-la".
Proposed resolution
Convert the test locales to lowercase in the comparison.
Remaining tasks
N/A
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Comment | File | Size | Author |
---|---|---|---|
#8 | smartling-lowercase-2683595-8-D7.patch | 1.04 KB | bighappyface |
#2 | smartling-lowercase-2683595-2-D7.patch | 1.55 KB | bighappyface |
Comments
Comment #2
bighappyface CreditAttribution: bighappyface at Rackspace for Rackspace commentedComment #3
pobster CreditAttribution: pobster as a volunteer and for Rackspace commentedLooks great to me! +1
Thank you,
Pobster
Comment #4
pobster CreditAttribution: pobster as a volunteer and for Rackspace commentedComment #5
Soul88Hey, David.
Could you please give me more info on how did you get the case mismatch?
Because we never lowercase locales from the settings. So the way you get notices is to somehow get the case of locale in code and locale in settings mismatch. And for now I can not see how that could happen.
//one of the possible conclusions from the reasoning above is that if we change the locale case we should also do it before saving to settings.
Comment #6
Soul88Close for now. Please, feel free to re-open it.
Comment #7
bighappyface CreditAttribution: bighappyface at Rackspace for Rackspace commented@Soul88 I have re-opened this and have a demonstration of the issue below:
Because the locale per Smartling is "es-LA" the
convertLocaleSmartlingToDrupal
method call returns nothing because it can't find a case-specific match.How the values were stored as lowercase in that array I do not know, but it certainly wasn't us and I think normalizing strings for the comparison makes sense.
Also, I think this issue is causing problems with the Smartling callback. We are only seeing updates come through for our "de" locale and while we see callbacks in the server access logs for "es-LA" the updates are not yet showing.
I think I will patch
convertLocaleSmartlingToDrupal
instead of patching the arguments to produce more universal and BC behavior.Comment #8
bighappyface CreditAttribution: bighappyface at Rackspace for Rackspace commentedComment #9
bighappyface CreditAttribution: bighappyface at Rackspace for Rackspace commented@Soul88 I have applied the latest path (#8) in production and not only is the bulk status check working, but the callback is working for mixed-case locales as well.
Please review.
Comment #10
Soul88Will review it shortly
Comment #12
Soul88Commited to master, thank you David.
Comment #13
Soul88