Active
Project:
#translatable
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Apr 2008 at 09:13 UTC
Updated:
5 Sep 2008 at 13:29 UTC
I have a content-type that contains an CCK image field. The content-type is checked as translatable.
When I create a new translation, the image is not displayed (http://drupal.org/node/249204) and if I try to upload another image, it generates a fopen error.
Sometimes (depending on the node) the original image is displayed in the translation and sometimes not.
The image should be presented in the form (maybe with the upload button disabled for a first version) and the user should be able to translate the alt and title fields.
It is filed as a bug as #translatable is CCK-ready.
Comments
Comment #1
sunFrom a high level view, the cause for this is that Imagefields are AHAH-enabled sub-forms in a node form. Also providing a multilingual solution for those fields is not trivial, since one might want to translate only the title + alt attribute (if enabled), and another one also wants to change/translation the image itself.
Comment #2
magoo commentedSo this means that there currently is no support at all for content-types containing CCK images!
This is important to say to potential future users because the CCK by design compatibility sentence is misleading.
Sad, as #translatable was my candidate of choice for multi-lingual sites and this could be a show stopper.
Comment #3
sunAs a workaround you can implement a form_alter() function in a custom module and set an imagefield to
'#translatable' => FALSE. This will hide Imagefields from the translation form, but use the same field values in translations.Comment #4
magoo commentedHello,
is there a comprehensive explanation on how to do this (form_alter) somewhere?
thanks in advance
Comment #5
sunYou might have a look at:
http://drupal.org/search/node/form_alter+type%3Abook
Comment #6
magoo commentedI think I will go this way but from my point of view, the module should set
'#translatable' => TRUEonly for content types it is able to manage. (although I do not change the category, still from my point of view, this is a bug and not a feature request).And maybe produce a list of supported fields type.
my 2 cents,
magnus
Comment #7
magoo commentedThe
'#translatable' = > FALSEremoves the image fields from the translation form, which is fine.BUT
I have on the translation form an javascript error related to the imagefield
Sorry for the bad copy paste.
Is this related to the way translatable "presents" fields that are
'#translatable' = > FALSE?Comment #8
j0rd commentedAlright. I was having the same JS error as you. For me, I'm doing some hackery and it got me into trouble with drupal.js .
For me, if in form_alter i changed an Imagefield from type $form['field_myimagefield']['#type'] from fieldset to 'value' to hide it on the form, I was getting this same error.
Simple fix to remove this error is to do a check in the drupal.js to make sure "button" exists before we try and do stuff with it.
Change line 31 in your drupal.js from this
to this
This resolves your JS issue.
--
Freelance Website Design