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

Currency field is importing from Symfony/Intl polyfill but should not #6187

Closed
yobottehg opened this issue Feb 8, 2024 · 1 comment
Closed

Comments

@yobottehg
Copy link

yobottehg commented Feb 8, 2024

  • Laravel Version: v10.43.0
  • Nova Version: 4.32.11
  • PHP Version: 8.2.15
  • Database Driver & Version: MariaDB 10.5.9
  • Operating System and Version: Ubuntu 22.04
  • Browser type and version: Chrome latest
  • Reproduction Repository: https://github.com/###/###

Description:

Nova field Currency imports from the Symfony polyfill which is bad practice as it requires the user to install the polyfill even if the intl extension is installed.

If you remove your polyfills like you should

    "replace": {
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-intl-grapheme": "*",
        "symfony/polyfill-intl-normalizer": "*",
        "symfony/polyfill-intl-icu": "*",
        "symfony/polyfill-intl-idn": "*",
        "symfony/polyfill-mbstring": "*",
        "symfony/polyfill-php54": "*",
        "symfony/polyfill-php55": "*",
        "symfony/polyfill-php56": "*",
        "symfony/polyfill-php70": "*",
        "symfony/polyfill-php71": "*",
        "symfony/polyfill-php72": "*",
        "symfony/polyfill-php73": "*",
        "symfony/polyfill-php74": "*",
        "symfony/polyfill-php80": "*",
        "symfony/polyfill-php81": "*",
        "symfony/polyfill-php82": "*"
    }

Then the nova currency field does not work.

Detailed steps to reproduce the issue on a fresh Nova installation:

Replace src/Fields/Currency.php:9

Wrong:
use Symfony\Polyfill\Intl\Icu\Currencies;
Correct:
use Symfony\Component\Intl\Currencies;

@yobottehg yobottehg changed the title Currency field is importing from Intl polyfil Currency field is importing from Symfony/Intl polyfill but should not Feb 8, 2024
@crynobone
Copy link
Member

laravel/cashier-paddle#167
laravel/cashier-stripe#1114

This usage is widely used in Laravel packages.

@crynobone crynobone closed this as not planned Won't fix, can't repro, duplicate, stale Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants