Problem/Motivation

When Meta entity was launched, the first intended use was to store simple properties. But right now we notices we also store text which should be translatable. The problem is, meta entity was not declared as translatable entity.

Proposed resolution

Let's make it translatable.

Remaining tasks

* Change definition
* Data schema update
* (Functional) testing

User interface changes

API changes

MetaEntity can be marked as transatable

Data model changes

New base fields: langcode and default_langcode.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

huzooka created an issue. See original summary.

huzooka’s picture

Status: Active » Needs work

Here is the first draft.
Update seems to be OK; but maybe, in case of the preexisting entities, the language code should follow the langcode of the target entity. Now I just set it to the site's default language.

I didn't do any functional testing so far.

huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
  1. Updated annotation with the necessary properties
  2. Added schema update functions.
  3. Added a new update test which ensures entity schema is OK after updating from an old version.
  4. Also added a functional test to confirm that meta entities can be translated from the UI properly.

I also added a post update function to change the language of preexisting meta entities to the language of their target, but I'm not sure if we really need it. I'm happy to drop it if you also think so.

huzooka changed the visibility of the branch 3573926-type-collection to hidden.

huzooka’s picture

Status: Needs review » Needs work

Found an error with the update hook, the values in the field config tables aren’t copied during the schema update

huzooka’s picture

Assigned: Unassigned » huzooka
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review

I had to refine the upgrade path because at the first time I though I finished with this the values in field config tables were lost.
Another thing (after a short discussion with @dimilias) that most probably we want to release this change in a new major branch – although I wrote an upgrade path to cover also the affected Views configs, there might be custom code (plugins, hooks etc) which are using the old data schema.

andras_szilagyi’s picture

Status: Needs review » Reviewed & tested by the community

Looks good

claudiu.cristea made their first commit to this issue’s fork.

claudiu.cristea’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Make meta entities translatable

Merged and release in 8.x-1.6. Thank you all

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.