Download & Extend

Provide Entity Translation integration

Project:Media
Version:7.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

When I edit a node with a translated file (image) and I click on Edit Media, I expect to be able to edit the translated version of that entity, not the original.

- I've a content type Article with a Dutch translation.
- I've enable translations for the entity File and created a Dutch translation for a specific image
- While in the English interface, I've added the image to a node.
- When I switch the interface to Dutch I see the translated node and even the translated image beloning to the node
- When I EDIT the node, I have a button 'Edit media' (see screenshot). This opens a modal frame with a form to edit the image. This form however, shows the english version of the image. Not the Dutch version, as I expected.

See screenshot.

Schermafbeelding 2012-03-06 om 09.12.31.png

AttachmentSizeStatusTest resultOperations
Schermafbeelding 2012-03-06 om 09.12.31.png32.56 KBIgnored: Check issue status.NoneNone

Comments

#1

Subscribe,

I`have the same issue on file entities. I have an image file entities with some attached fields in french (I use Media with entity translation). when I add an image and translate it to english, all go well. but if I want to edit the translation, the edit form display the source entity that in french ?

#2

Status:active» postponed

This should be fixed once #1282018: Improve UX of language-aware entity forms is committed.

#3

Status:postponed» active

Does not work properly yet. Let's fix this.

#4

Title:'Edit media' on a node/edit form points to untranslated version of the entity» Provide media integration
Category:bug report» feature request

We need better integration with the Media project.

#5

#6

[double post removed]

#7

Attached patch (against media-7.x-2.x) adds ET support for the media edit modal popup, with the multiple-paths patch in #1418076-18: Allow for multiple base paths... We should probably open a new issue in the media issue queue once the multiple path issue is resolved.

AttachmentSizeStatusTest resultOperations
media-integration-2.x-dev-1470018.patch672 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 11 pass(es).View details

#8

Title:Provide media integration» Provide Entity Translation integration
Project:Entity Translation» Media
Version:7.x-1.x-dev» 7.x-2.x-dev
Component:User interface» Code
Status:active» needs review

The attached patch adds ET integration for the Media modal popup (requires #1418644-7: Add multilingual support for files and #1418076-22: Allow for multiple base paths).

AttachmentSizeStatusTest resultOperations
media-et_integration-1470018-8.patch3.5 KBIdlePASSED: [[SimpleTest]]: [MySQL] 11 pass(es).View details

#9

Better UX: now the link to create a translation uses the canonical local action theming. Moreover now it is possible to create a translation only in if it is missing the current content language. This way context is always kept and pressing the 'Edit media' button allows to edit the values for the current language or create a translation for the current language. Full administration of translations is still available at file/%file/translate.

#10

Ahem

AttachmentSizeStatusTest resultOperations
media-et_integration-1470018-10.patch3.3 KBIdlePASSED: [[SimpleTest]]: [MySQL] 11 pass(es).View details

#11

Minor fix.

AttachmentSizeStatusTest resultOperations
media-et_integration-1470018-11.interdiff.do_not_test.patch771 bytesIgnored: Check issue status.NoneNone
media-et_integration-1470018-11.patch3.4 KBIdlePASSED: [[SimpleTest]]: [MySQL] 11 pass(es).View details

#12

This and #1418644: Add multilingual support for files are the last blockers for the first Entity Translation beta. It would be great to have some feedback ASAP :)

#13

Status:needs review» needs work

Awesome, patch #11 works very well and makes translating media files soooo much easier! :)

I only have two questions/issues and think it's RTBC otherwise:

+++ b/includes/MediaEntityTranslationHandler.inc
@@ -0,0 +1,54 @@
+    if (isset($form['actions']['delete_translation'])) {
+      $form['actions']['delete_translation']['#weight'] = 10;
+    }

This is only for the "file/x/edit" pages, right? For the media path scheme it doesn't do anything because the "delete translation" action is removed anyway... So does this belong into media or should it be in file_entity?

+++ b/includes/MediaEntityTranslationHandler.inc
@@ -0,0 +1,54 @@
+        $form['media_add_translation'] = array(
+          '#weight' => -110,
+          '#markup' => '<ul class="action-links"><li>' . $link . '</li></ul>',
+        );

Can we reuse some existing theming function for this?

#14

This is only for the "file/x/edit" pages, right? For the media path scheme it doesn't do anything because the "delete translation" action is removed anyway... So does this belong into media or should it be in file_entity?

Nice catch :) This actually would belong to File Entity, but I thought it didn't make sense to introduce a FileEntityTranslationHandler just for those two lines. Do you think it's worth?

Can we reuse some existing theming function for this?

I wasn't able to find a proper theming function. See Bartik's page.tpl.php.

#15

Status:needs work» needs review

Nice catch :) This actually would belong to File Entity, but I thought it didn't make sense to introduce a FileEntityTranslationHandler just for those two lines. Do you think it's worth

No, I guess not. Let's leave it in here for now. (Unless media module maintainers object?)

I wasn't able to find a proper theming function. See Bartik's page.tpl.php.

Hm, looks like there's no theming function for the list then, but we can use 'menu_local_action' for the link... patch updated.

AttachmentSizeStatusTest resultOperations
media-et_integration-1470018-15.interdiff.do_not_test.patch1.53 KBIgnored: Check issue status.NoneNone
media-et_integration-1470018-15.patch3.52 KBIdlePASSED: [[SimpleTest]]: [MySQL] 11 pass(es).View details

#16

Status:needs review» reviewed & tested by the community

Works for me.

#17

Updated the patch for the change introduced in #1799770: Update id and bundle when setting a wrapped entity (removed $entity_id from handler constructor).

AttachmentSizeStatusTest resultOperations
media-et_integration-1470018-17.interdiff.do_not_test.patch625 bytesIgnored: Check issue status.NoneNone
media-et_integration-1470018-17.patch3.5 KBIdlePASSED: [[SimpleTest]]: [MySQL] 11 pass(es).View details

#18

That was the last serious API change for Entity Translation before beta1. You can commit #17 safely, if you are happy with it.

#19

Status:reviewed & tested by the community» fixed

I am happy with it, thought at first that this should be in file entity module, but i see this is about media path.
thanks both

#20

Status:fixed» closed (fixed)

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

nobody click here