imho, $data['entity_type']['translation_link'] definitions should be moved to Content translation module.

Files: 
CommentFileSizeAuthor
#22 translation_link-2035587-22.patch4.32 KBvasike
PASSED: [[SimpleTest]]: [MySQL] 57,424 pass(es).
[ View ]
#20 translation_link-2035587-20.patch4.13 KBvasike
PASSED: [[SimpleTest]]: [MySQL] 56,789 pass(es).
[ View ]
#16 translation_link-2035587-16.patch4.12 KBvasike
PASSED: [[SimpleTest]]: [MySQL] 57,115 pass(es).
[ View ]
#14 translation_link-2035587-14.patch4.12 KBvasike
PASSED: [[SimpleTest]]: [MySQL] 57,248 pass(es).
[ View ]
#8 translation_link-2035587-8.patch4.13 KBvasike
PASSED: [[SimpleTest]]: [MySQL] 56,634 pass(es).
[ View ]
#6 translation_link-2035587-6.patch4.11 KBvasike
FAILED: [[SimpleTest]]: [MySQL] 56,846 pass(es), 0 fail(s), and 6 exception(s).
[ View ]
#5 translation_link-2035587-5.patch4.24 KBvasike
PASSED: [[SimpleTest]]: [MySQL] 56,510 pass(es).
[ View ]
#1 translation_link-2035587-1.patch4.02 KBvasike
FAILED: [[SimpleTest]]: [MySQL] 57,186 pass(es), 2 fail(s), and 11 exception(s).
[ View ]

Comments

StatusFileSize
new4.02 KB
FAILED: [[SimpleTest]]: [MySQL] 57,186 pass(es), 2 fail(s), and 11 exception(s).
[ View ]

here is patch for this.

i think this field needs a solution for the broken handler case, maybe #1825896: Add module owner to plugin data on handlers.

Status:Active» Needs review

forgot the status change.

Issue tags:+D8MI, +VDC

and some tags

Status:Needs review» Needs work

The last submitted patch, translation_link-2035587-1.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new4.24 KB
PASSED: [[SimpleTest]]: [MySQL] 56,510 pass(es).
[ View ]

indeed the patch won't fit for user entities: they have "users" table name instead of "user".
i think it requires a fix for #140860: Consistent table names and database handling of table names.

but till then here is a new patch that deals with this issue.

p.s. other issue about the same users table #330983: Rename user module tables to singular.
probably there could be others issues, but the queue it's quite big.

StatusFileSize
new4.11 KB
FAILED: [[SimpleTest]]: [MySQL] 56,846 pass(es), 0 fail(s), and 6 exception(s).
[ View ]

new patch

Status:Needs review» Needs work

The last submitted patch, translation_link-2035587-6.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new4.13 KB
PASSED: [[SimpleTest]]: [MySQL] 56,634 pass(es).
[ View ]

indeed. old code
new patch

Status:Needs review» Needs work

The last submitted patch, translation_link-2035587-8.patch, failed testing.

Status:Needs work» Closed (works as designed)

I strongly disagree: the Content Translation module knows nothing about nodes, comments or any other entities. It's up to the single entity-defining modules to provide the integration code, exactly as they do for Views-related stuff. Aside from an architectural perspective, this won't scale as this way CT would be "responsible" to provide such code for any entity type out there.

Status:Closed (works as designed)» Needs work

Sorry, if this can be done in a generic way I agree it should be in the CT module.

Status:Needs work» Needs review

#8: translation_link-2035587-8.patch queued for re-testing.

Overall this looks good to me, thanks. I am not sure whether the current approach is the best way to detect entities, so I asked @timplunkett's feedback. Hope we'll hear from him soon :)

Meanwhile:

+++ b/core/modules/content_translation/content_translation.views.inc
@@ -0,0 +1,27 @@
+    // only Entities Views data that have translation enabled.

there is a missing capital letter (or an entire word?) here.

StatusFileSize
new4.12 KB
PASSED: [[SimpleTest]]: [MySQL] 57,248 pass(es).
[ View ]

update the help code.

+++ b/core/modules/content_translation/content_translation.views.inc
@@ -0,0 +1,27 @@
+    // only for Entity Types that have translation enabled.

Missing capital still there.

StatusFileSize
new4.12 KB
PASSED: [[SimpleTest]]: [MySQL] 57,115 pass(es).
[ View ]

i hope you meant the first letter from comment.

Yep, thanks. Still waiting for @timplunkett's feedback.

Status:Needs review» Reviewed & tested by the community

+1

+++ b/core/modules/content_translation/content_translation.views.incundefined
@@ -0,0 +1,27 @@
+      // Content translation field.

I would skip that comment as it doesn't seem to add valuable information

+++ b/core/modules/content_translation/content_translation.views.incundefined
@@ -0,0 +1,27 @@
+        'help' => t('Provide a link to the translations overview for @entity_type_label.', array('@entity_type_label' => $table_info['table']['group'])),

I guess the entity type label should better be taken directly from the entity type.

Status:Reviewed & tested by the community» Needs work

Status:Needs work» Needs review
StatusFileSize
new4.13 KB
PASSED: [[SimpleTest]]: [MySQL] 56,789 pass(es).
[ View ]

@dawehner : imho the solution below should be just a temporary solution.
and the real solution should be a generic Views approach for Entities, where Views should know and use all the entities definitions for building the Views data, except too specific entities types data - no more hook_views_data() if possible, or in this case hook_views_data_alter() implementation.

p.s. : update the comment

Status:Needs review» Needs work

Right (see #1740492: Implement an entity views data controller), but the API freeze was like a while ago. Back to needs work based on my previous comment.

Status:Needs work» Needs review
StatusFileSize
new4.32 KB
PASSED: [[SimpleTest]]: [MySQL] 57,424 pass(es).
[ View ]

i see and i'm sure that entity views data controller it will be implemented eventually.

here is a new patch that uses entity info data for entity type label.

Issue tags:+Needs tests

Thank you very much! It seems to make sense to add a test to ensure that this code actually works.

Status:Needs review» Needs work

Looks good to me too but we are still missing tests.