Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove calls to old CLDR #12999

Merged
merged 17 commits into from Apr 5, 2019

Conversation

Quetzacoalt91
Copy link
Member

@Quetzacoalt91 Quetzacoalt91 commented Mar 21, 2019

Questions Answers
Branch? develop
Description? The CLDR feature has been replaced in the core. This PR removes the old classes.
Type? improvement
Category? CO
BC breaks? Yes, Tools::getCldr(), and all classes in PrestaShop\PrestaShop\Core\Cldr
Deprecations? Nope
Fixed ticket? Fixes #10052 and #12659
How to test? Prices are displayed on the front office properly

This change is Reviewable

@prestonBot prestonBot added develop Branch Improvement Type: Improvement labels Mar 21, 2019
@Quetzacoalt91 Quetzacoalt91 force-pushed the remove-old-cldr branch 6 times, most recently from 0cf74fe to 0a0cdaa Compare March 25, 2019 15:00
@Quetzacoalt91 Quetzacoalt91 marked this pull request as ready for review March 25, 2019 15:02
@Quetzacoalt91 Quetzacoalt91 reopened this Mar 25, 2019
@Quetzacoalt91 Quetzacoalt91 force-pushed the remove-old-cldr branch 2 times, most recently from 98a4990 to 6731d77 Compare March 25, 2019 16:23
classes/Currency.php Show resolved Hide resolved
classes/LocalizationPack.php Show resolved Hide resolved
src/Core/Grid/Query/CurrencyQueryBuilder.php Show resolved Hide resolved
src/Core/Grid/Query/CurrencyQueryBuilder.php Outdated Show resolved Hide resolved
src/Core/Localization/Currency.php Show resolved Hide resolved
@@ -158,7 +158,7 @@ services:
prestashop.core.form.choice_provider.currency_name_by_iso_code:
class: 'PrestaShop\PrestaShop\Core\Form\ChoiceProvider\CurrencyNameByIsoCodeChoiceProvider'
arguments:
- '@=service("prestashop.core.cldr.repository").getAllCurrencies()'
- '@=service("prestashop.core.localization.cldr.locale_repository").getLocale(service("prestashop.adapter.legacy.context").getContext().language.getLocale()).getAllCurrencies()'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow!! 🤪
I get the logic but it's quite a long expression, do you think there might a service that could do this more easily? Although I don't have the solution, it's a question? ^^

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I also thought about a dedicated service, but I wonder if it's a good idea.
As we rely on a context attribute (language), I do not want to see a service initialized too early and see it empty.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I see the problem, maybe we would need a service with the legacy context, which would have getContextLocale getContextCurrency (rough idea..) which would be resolved on the fly
But anyway it's not the purpose of this PR

jolelievre
jolelievre previously approved these changes Mar 29, 2019
@jolelievre jolelievre added the Waiting for QA Status: action required, waiting for test feedback label Mar 29, 2019
@Quetzacoalt91 Quetzacoalt91 removed the Waiting for QA Status: action required, waiting for test feedback label Mar 29, 2019
Copy link
Contributor

@tomlev tomlev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @eternoendless, @jolelievre, and @PierreRambaud)


src/Core/Localization/Specification/Number.php, line 332 at r10 (raw file):

Previously, eternoendless (Pablo Borowicz) wrote…

Why not add it in its constructor then?

that's was before, it makes CLDR reference and prestahop currency coupled. I think it is better to get price spec from the reference THEN override the precision.

Else we have to pass a not-required precision to construct the spec

eternoendless
eternoendless previously approved these changes Apr 3, 2019
Copy link
Member

@eternoendless eternoendless left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r15.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @jolelievre and @PierreRambaud)

@eternoendless eternoendless added the Waiting for QA Status: action required, waiting for test feedback label Apr 3, 2019
@marionf
Copy link
Contributor

marionf commented Apr 4, 2019

@mbadrani Could you launch CLDR E2E tests ?

@marionf marionf added QA ✔️ Status: check done, code approved and removed Waiting for QA Status: action required, waiting for test feedback labels Apr 4, 2019
Copy link
Member

@eternoendless eternoendless left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 25 files at r16, 3 of 8 files at r17, 5 of 9 files at r18, 5 of 6 files at r19, 4 of 4 files at r20, 1 of 3 files at r22, 1 of 1 files at r23, 1 of 1 files at r24.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @jolelievre, @mbadrani, and @PierreRambaud)

@eternoendless
Copy link
Member

🎉 Thank you @Quetzacoalt91 and @tomlev!

@eternoendless eternoendless merged commit 1085d7f into PrestaShop:develop Apr 5, 2019
@eternoendless eternoendless added the BC break Type: Introduces a backwards-incompatible break label Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BC break Type: Introduces a backwards-incompatible break develop Branch Improvement Type: Improvement QA ✔️ Status: check done, code approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FF-165] Replace old CLDR code
8 participants