Fix translatable presence validator for hyphenated locales#8795
Fix translatable presence validator for hyphenated locales#8795ahukkanen merged 2 commits intodecidim:developfrom
Conversation
534aae1 to
b6e80a9
Compare
|
We are no longer using Rectify for the forms as of #8669. It has been replaced with The new form class is not converting the hash keys with the However, the fix you have done at the There seems to be another bug also in that class at the end of the Instead of returning an array at the end of the method, I believe it should return |
Wohoo! These are great news! I'll update the PR to address your comments |
b6e80a9 to
9f41e6f
Compare
|
I've updated the PR 😄 Regarding this:
Have default to I'm open to any suggestions 😄 |
9f41e6f to
bec2c48
Compare
I did not mean to remove the error adding. I think adding the error is fine but returning the array will cause some issues if it ever goes there (which is pretty rare). What I meant was just to replace the line that says Please also run rubocop, there is a linter issue with your code. See: |
When translatable-attributes are defined, it does replaces `-` with `__`. The validator was missing this conversion and wasn't able to find the proper method This fixes the translatable-presence-validator for hypenated locales
Returns the proper error when there is no current_organization during validation
bec2c48 to
8715b66
Compare
Got it! PR is ready again, just put back the error-adding and have run rubocop as well Thanks for all the input @ahukkanen 😄 |
ahukkanen
left a comment
There was a problem hiding this comment.
Really good fix with added tests. Tested this locally by setting the default locale to es-MX and it works correctly.
Great work!
* develop: (57 commits) Add a subtitle to assemblies and processes pages (#8918) Add a subtitle to votings page (#8919) Fix profile notifications (#8943) Fix email for verification conflict with managed users (#8926) Move VAPID keys generators to core (#8923) Fix officialized user event missing translations (#8927) Fix verification report with multitenants: notify it only to admins of that organization (#8929) Fix processes creation form with stats, metrics and announcements (#8925) Fix flaky spec in meetings multi-date selectors (#8924) Local HTML validator for the CI (#8937) Fix translatable presence validator for hyphenated locales (#8795) Fix link to docs in initiatives admin (#8921) Fix initiatives signatures issues (#8448) Fix the meetings export to also include unpublished meetings (#8874) Fix heading order in the consultation question page (#8920) Fix diff mode selector roles and tabindexes (#8912) Fix budget hard dependency and caching flag issues in comments (#8899) Fix emoji picker hiding Foundation Abide form errors (#8886) Fix logical heading order for the endorsers list (#8892) Fix Foundation Abide errors for Rails remote (AJAX) forms (#8889) ...
🎩 What? Why?
Fix TranslatablePresenceValidator - Hyphenated locale
When translatable-attributes are defined, it does replaces
-with__. The validator was missing this conversion and wasn't able to findthe proper method
This fixes the translatable-presence-validator for hypenated locales
📌 Related Issues
Testing
Have added tests, but I think other way of validating this fix is by following the described issue at #8787
📋 Checklist
docs/.📷 Screenshots
Please add screenshots of the changes you're proposing
