Problem/Motivation

translation_entity.module keeps track of entity translations in its {translation_entity} table. For each translation it stores the entity ID, which it accesses by EntityInterface::id(), and tries to do so in a field of type 'int'. ContentEntities are fine with that, but ConfigEntities return their machine name, which results in a fatal SQL error, when it tries to save an entity translation along the lines of

Error message
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 1366 Incorrect integer value

In order to reproduce this, turn on entity_translation.module and then in a second step turn on contact.module. That tries to save the default contact category and BOOM!

I filed this as major, it might be considered critical, but I didn't want to piss people off, and this should be a rather easy one anyway, so...

Proposed resolution

Change the SQL field to type 'varchar'.

Remaining tasks

Write tests. I don't think we need either an upgrade path or upgrade path tests.

User interface changes

-

API changes

-

Files: 
CommentFileSizeAuthor
#7 1832932-4-translation-entity-broken.patch4.68 KBattiks
PASSED: [[SimpleTest]]: [MySQL] 47,596 pass(es).
[ View ]
#5 1832932-4-translation-entity-broken-tests-only.patch3.96 KBtstoeckler
FAILED: [[SimpleTest]]: [MySQL] 47,597 pass(es), 0 fail(s), and 1 exception(s).
[ View ]
#4 1832932-4-translation-entity-broken-tests-only-do-not-test.patch3.96 KBtstoeckler
#4 1832932-4-translation-entity-broken.patch4.68 KBtstoeckler
PASSED: [[SimpleTest]]: [MySQL] 47,590 pass(es).
[ View ]
#1 1832932-1-translation-entity-broken.patch647 byteststoeckler
FAILED: [[SimpleTest]]: [MySQL] Repository checkout: failed to checkout from [git://git.drupal.org/project/drupal.git].
[ View ]

Comments

Status:Active» Needs review
Issue tags:+Needs tests
StatusFileSize
new647 bytes
FAILED: [[SimpleTest]]: [MySQL] Repository checkout: failed to checkout from [git://git.drupal.org/project/drupal.git].
[ View ]

Here we go.

Will now try to cook up some tests.

Status:Needs review» Needs work

The last submitted patch, 1832932-1-translation-entity-broken.patch, failed testing.

That was luck, that it failed on checkout. The patch breaks because I failed to update the schema keys correctly. *slapsforehead*
Better patch coming up.

Status:Needs work» Needs review
StatusFileSize
new4.68 KB
PASSED: [[SimpleTest]]: [MySQL] 47,590 pass(es).
[ View ]
new3.96 KB

StatusFileSize
new3.96 KB
FAILED: [[SimpleTest]]: [MySQL] 47,597 pass(es), 0 fail(s), and 1 exception(s).
[ View ]

Well, obviously the "tests-only" patch *should* be tested... (it's late...)

Status:Needs review» Needs work

The last submitted patch, 1832932-4-translation-entity-broken-tests-only.patch, failed testing.

Status:Needs work» Reviewed & tested by the community
Issue tags:-Needs tests
StatusFileSize
new4.68 KB
PASSED: [[SimpleTest]]: [MySQL] 47,596 pass(es).
[ View ]

Looks good, I'm uploading the patch from #4 to avoid confusion.

Status:Reviewed & tested by the community» Fixed

Committed and pushed to 8.x. Thanks!

Status:Fixed» Reviewed & tested by the community

Thanks for the quick commit, but I don't think this was actually pushed...

Status:Reviewed & tested by the community» Fixed

Sorry, here it is: http://drupalcode.org/project/drupal.git/commit/d65270d499b1c350e93521bf...

It seems the Drupal.org commitlog is cached in some way. Weird, I've never seen that before...

Status:Fixed» Closed (fixed)

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