fix: remove unreachable ucwords fallback in GoogleAdwords UppercaseTitle - #40946
Open
lbajsarowicz wants to merge 1 commit into
Open
fix: remove unreachable ucwords fallback in GoogleAdwords UppercaseTitle#40946lbajsarowicz wants to merge 1 commit into
lbajsarowicz wants to merge 1 commit into
Conversation
Call mb_convert_case() directly because ext-mbstring is a hard Composer requirement for Magento 2.4-develop. Add multibyte title-case coverage to preserve the intended behavior.
|
Hi @lbajsarowicz. Thank you for your contribution!
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
Contributor
Author
|
@magento run all tests |
Contributor
|
@magento create issue |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Remove the unreachable
ucwords()fallback fromMagento\GoogleAdwords\Model\Filter\UppercaseTitle::filter().Problem
The filter guards
mb_convert_case()behind afunction_exists()check with anucwords()fallback:ext-mbstringis a hard requirement in Magento's rootcomposer.json, so the fallback is unreachable. If it ever ran,ucwords()would also mangle multibyte titles — the fallback is not even behavior-equivalent.Solution
Call
mb_convert_case()directly. A multibyte case ('łukasz ünique title'→'Łukasz Ünique Title') is added to the unit test data provider to lock in the intended multibyte behavior.Files Changed
app/code/Magento/GoogleAdwords/Model/Filter/UppercaseTitle.phpapp/code/Magento/GoogleAdwords/Test/Unit/Model/Filter/UppercaseTitleTest.phpRelated Pull Requests
Same cleanup pattern as #40686, #40687, #40688.
Manual testing scenarios (*)
app/code/Magento/GoogleAdwords/Test/Unit/— all tests pass, including the new multibyte case.Contribution checklist (*)
Resolved issues: