Ensure translatable resources save their fields as JSON objects#6587
Merged
tramuntanal merged 32 commits intodevelopfrom Oct 8, 2020
Merged
Conversation
oriolgual
previously approved these changes
Oct 2, 2020
bca869c to
ee55b77
Compare
Contributor
Author
|
@decidim/core can you review this PR, please? This fixes some bugs with the i18n of proposals, comments and other models. More specifically, at some point some if these models get updated and instead of having their titles saved as a JSONB object they're saved as strings, thus breaking the whole i18n support and the machine translations service. This Pr ensures that those fields are actually saved as JSONB objects. |
559481f to
fdff787
Compare
Contributor
Author
|
@decidim/core all green now, can you reeview this please? It fixes bugs! |
Contributor
Author
|
@tramuntanal @decidim/core friendly reminder about this PR! It fixes some bugs caused by the recent machine translation system :) |
Instead of strings.
0fba5a9 to
136a3fe
Compare
tramuntanal
approved these changes
Oct 8, 2020
Contributor
|
we're taking care of the backport to 0.23 |
tramuntanal
pushed a commit
that referenced
this pull request
Oct 8, 2020
* Ensure translatable resources save their fields as JSON objects Instead of strings. * Lint files * Don't make collaborative drafts translatable * Don't make proposal notes translatable * Don't make surveys translatable * Remove missing field * Fix pages specs * Fix budgets specs * Fix comments specs * Fix assemblies specs * Fix core tests * Fix debates specs * Don't translate answer choices * Fix initiatives specs * Lint files * Lint more files * Fix meetings * Fix process specs * Fix proposals unit tests * Fix proposals admin system specs * Remove unused property * Fix proposal public system specs * Fix spec * Fix more accountability specs * Fix core specs * Fix proposals factories * Ensure attachments title and description are hashes * Lint file * Fix migration * Improve migration * Lint file * Fix proposals specs
Merged
12 tasks
tramuntanal
added a commit
that referenced
this pull request
Oct 8, 2020
… (#6646) * Ensure translatable resources save their fields as JSON objects Instead of strings. * Lint files * Don't make collaborative drafts translatable * Don't make proposal notes translatable * Don't make surveys translatable * Remove missing field * Fix pages specs * Fix budgets specs * Fix comments specs * Fix assemblies specs * Fix core tests * Fix debates specs * Don't translate answer choices * Fix initiatives specs * Lint files * Lint more files * Fix meetings * Fix process specs * Fix proposals unit tests * Fix proposals admin system specs * Remove unused property * Fix proposal public system specs * Fix spec * Fix more accountability specs * Fix core specs * Fix proposals factories * Ensure attachments title and description are hashes * Lint file * Fix migration * Improve migration * Lint file * Fix proposals specs Co-authored-by: Marc Riera <mrc2407@gmail.com>
12 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.
🎩 What? Why?
We want to make sure translatable resources save their transaltable fields as they should: as key-value hashes and not plain strings. We're having problems because it turns out that a plain string is a valid value for a JSONB field in the db.
With this PR we add a validation to the translatable resources to make sure the fields are properly saved, and detect where they are not.
Todo:
titleanddescription📌 Related Issues
Testing
Let tests run.
📋 Checklist
🚨 Please review the guidelines for contributing to this repository.
docs/.📷 Screenshots
None