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

Taxon resolution ruleset change #147

Closed
lchrusciel opened this issue May 11, 2020 · 3 comments
Closed

Taxon resolution ruleset change #147

lchrusciel opened this issue May 11, 2020 · 3 comments

Comments

@lchrusciel
Copy link

lchrusciel commented May 11, 2020

Hey folks 👋

First of all, thanks for all the work you've put into all doctrine repositories.

Recently, you've published version 1.4, which fixed how taxon is pluralized, however, this fix fails a lot of Sylius builds. Even tho, proper plural form of a taxon is taxa, for the last few years, we were using taxons (and TBH no one spotted a problem with it. I guess it is due to not the common usage of this word and not too much of native speakers in our community). We are using an inflector to dynamically create routes, which blocked part of our admin panel after the update (admin/taxons became admin/taxa).

Nonetheless, we had to conflict with the newest inflector to make our builds pass. Not sure, if there is anything to fix on your side, as you in the core of the problem improved this library, but your fix broke backward compatibility at least for our project. I'm posting it here, so maybe some of you would have some recommendations for us, how to fix it on our side. Also, maybe this issue will be useful for some other folks out there.

As a ref. Sylius/Sylius#11441

@greg0ire
Copy link
Member

I would recommend you redirect admin/taxons to admin/taxa, and trigger a deprecation when admin/taxons is in use.

@alcaeus
Copy link
Member

alcaeus commented May 11, 2020

As this fixed a bug, we won't change it back. However, if you want to preserve the original behaviour, you can add the following call (works in the legacy API as well) to ensure you always have the correct translation:

Inflector::rules('plural', ['taxon' => 'taxons']);

This will make sure that "taxon" will be pluralised to "taxons" and vice-versa. Closing as there's nothing to fix. Thanks for bringing it to our attention.

@alcaeus alcaeus closed this as completed May 11, 2020
@ambroisemaupate
Copy link

Inflector::rules('plural', ['taxon' => 'taxons']);

triggers a warning as taxon is used as a regex pattern. This should be

Inflector::rules('plural', ['/taxon/i' => 'taxons']);

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

4 participants