Needs review
Project:
Active Translation
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Jul 2009 at 14:20 UTC
Updated:
15 Nov 2010 at 16:03 UTC
Jump to comment: Most recent file
Comments
Comment #1
drewish commentedthis looks good over all some of the comments need to be proper sentences with capital letter and periods though. i think the view should probably be tagged with the module name.
though it brings up a bigger problem with the module, it's using ***CURRENT_LANGUAGE*** as a field name. the problem being that language codes conflict with database reserved works. i'm sure using Icelandic you'll get a column named "is". i won't let fixing that block the views support but it just reminded me of it.
Comment #2
ekes commentedThe views replacement is just done by a
str_replaceso it would easy enough to move it to tnid_is (as tnid_***CURRENT_LANGUAGE***) or what ever if the column names were to change.Comment #3
ekes commentedTalking about c&p errors - corrected patch
Comment #4
nwe_44 commentedHas this patch been implemented in the dev release? I'm getting error messages on a multilingual site on a page using a view with a node reference argument. The multilingual options on the node reference argument are turned on. When they are turned off, the error messages disappear, but translations of referenced content are no longer taken in to account.
The error message is as follows
Comment #5
ekes commentedThe patch isn't in the module no. Any multilingual options therefore I guess are from i18n which is going to be a strange play. Why not try the patch and not the i18n options ;)
Comment #6
nwe_44 commentedFantastic, patch worked a treat for me. Thanks very much.
Comment #7
NaX commentedIt took me a while to workout why I could not create an admin view listing all nodes regardless of language.
Started working on my own fix using a views filter until I saw this patch.
Works for me, Thanks.
Comment #8
NaX commentedThere is a problem with relationship handler. It needs to use db_escape_table() on the current language. I run into this problem with the language Chinese. The table column is zhhans and the language code is zh-hans.
Comment #9
NaX commentedI have updated the relationship to use a handler. For some reason WinMerge is giving me errors and I don’t have my Suse machine with me so, sorry I cant give you a patch, but here is the code.
Please note that my views coding experience is limited.
active_translation.views.inc
active_translation_relationship_handler.inc
Comment #10
YK85 commentedsubscribing
I'm looking for an alternate to http://drupal.org/project/select_translation as it looks to not be maintained.
I hope this feature request can incorporate Views 3 support.
Thanks!
Comment #11
ekes commentedTaking #9 I've made another patch with slightly more standardized directory and filenames. I've also corrected one of my original un-needed complexities (using the alter hook rather than just putting it into a active_translation part of the views handlers).
I'm leaving this as 'needs review' because of the changes; so if someone has time please do. Other than that this is now pretty well tested I'd say. Trouble with committing it though would be that it will break the assumptions on sites that already have active_translation and views - guess it could be 2.x.
I'll post another version of this to follow up with some useful (but not so tested) relationship handlers for nodequeue and flag.
Comment #12
ekes commentedOK this isn't ready to be committed, just sharing. I've added handlers for nodequeue and flag. I know you can do this by effectively joining on active_translation then joining back on node and then joining nodequeue/flag to this, but my reason for using active_translation is to cut back on these draining joins so this just joins directly to active_translation.
(Oh it's a git patch and I forgot --no-prefix so patch -p1)
Comment #13
ekes commentedI've just worked out that #9 breaks if you are joining the active_translation onto anything other than the base table. A better solution seems to be to just:-
I'm poking other options.
(code is on git://git.iskra.net/drupal/contrib/active_translation too by the way).
Comment #14
drewish commentedthe mention of using db_escape_table() on the field names reminds me about #791172: Active translation with Tongan causes SQL errors. Wonder if fixing that there would make the views support easier to add...
Comment #15
ekes commentedDoes it still need to go through db_escape_table() as well as getting the lang_ prefix. If it was just the lang_ prefix then it would make the views support much easier, because the ***CURRENT_LANGUAGE*** replacement that already exists would work out-the-box.
Comment #16
NaX commented@ekes
I would say yes, see comment #8.