Posted by h3000 on April 15, 2009 at 1:16am
| Project: | Internationalization |
| Version: | 7.x-1.x-dev |
| Component: | Blocks |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (works as designed) |
Issue Summary
Hi,
I am experiencing problems with translated node items not appearing in the nodequeue when viewed in translated language - currently using current version of nodequeue - 6.x-2.0 and i18n - 6.x-1.0.
I have modified view settings to show the current user's language as well as nodes that have no translations.
Included in the queue was a node with a translation. However when the queue is viewed in the translated language, the translated node does not appear in the list.
Current setup is:
Drupal 6.10
Nodequeue 6.x-2.0
i18n 6.x-1.0
Apache 2
PHP 5
MySQL 5
Thanks.
Comments
#1
subscribing
i'm using the latest dev version together with translation helpers (drupal 6.10, php5 mysql5)
even if i choose "Treat translation nodes as a single node" when i switch to a language i can only see the original nodes (i see an empty page for the other languages.)
#2
Can you clarify where the translated nodes are not appearing? They're not appearing in the View of the queue, or on the queue manipulation page? If the View is giving you the unwanted behavior, can you paste an export of the view here?
Based on the patch to i18n that got applied a long time ago, I would think that displaying the translated node in a view would be handled by i18n's db_rewrite_sql. However, I do notice that the current user's language Views filter adds an "AND (node.language in ('***CURRENT_LANGUAGE***'))" to the query, which won't work if the original node is in one language and the translation language is therefore note stored in node.language.
Once you clarify which problem you're having, we can pursue this further, probably in the i18n issue queue as a support request.
#3
i don't if this message was for me but i'll try to explain my problem.
i use the latest dev version of the 6x branch together with the latest version of views2 and translation helpers.
the goal is to have a unique queue for all supported language. So in this way i have to add only one node to the queue. when i click on the translation flags the queue has to show that node in the correct language.
I created the queue checking the "Treat translation nodes as a single node" option, then I added 4 nodes to the queue.
I modified the queue through views to display the fields i want, here is my view.
$view = new view;$view->name = 'nodequeue_1';
$view->description = 'Display a list of all nodes in queue \'notizie "in evidenza"\'';
$view->tag = 'nodequeue';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('relationships', array(
'nodequeue_rel' => array(
'id' => 'nodequeue_rel',
'table' => 'node',
'field' => 'nodequeue_rel',
'label' => 'queue',
'required' => 1,
'limit' => TRUE,
'qids' => array(
'1' => '1',
),
'relationship' => 'none',
),
));
$handler->override_option('fields', array(
'title' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 1,
'max_length' => '30',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'link_to_node' => 1,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
'override' => array(
'button' => 'Override',
),
),
'field_copertina_fid' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'link_to_node' => 0,
'label_type' => 'none',
'format' => 'autocomplete_url',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_copertina_fid',
'table' => 'node_data_field_copertina',
'field' => 'field_copertina_fid',
'override' => array(
'button' => 'Sovrascrivi',
),
'relationship' => 'none',
),
'body' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 1,
'max_length' => '120',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'body',
'table' => 'node_revisions',
'field' => 'body',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('sorts', array(
'position' => array(
'id' => 'position',
'table' => 'nodequeue_nodes',
'field' => 'position',
'order' => 'ASC',
'relationship' => 'nodequeue_rel',
),
));
$handler->override_option('filters', array(
'status_extra' => array(
'id' => 'status_extra',
'table' => 'node',
'field' => 'status_extra',
'operator' => '=',
'value' => '',
'group' => 0,
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'relationship' => 'none',
),
'language' => array(
'operator' => 'in',
'value' => array(
'***CURRENT_LANGUAGE***' => '***CURRENT_LANGUAGE***',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'language',
'table' => 'node',
'field' => 'language',
'override' => array(
'button' => 'Sovrascrivi',
),
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('title', 'Queue \'notizie "in evidenza"\'');
$handler->override_option('items_per_page', 6);
$handler->override_option('use_pager', '1');
$handler->override_option('use_more', 1);
$handler = $view->new_display('page', 'Page', 'page');
$handler->override_option('path', 'notizie/inevidenza');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));
$handler = $view->new_display('block', 'Block', 'block');
$handler->override_option('items_per_page', 5);
$handler->override_option('use_pager', '0');
$handler->override_option('style_plugin', 'list');
$handler->override_option('style_options', array(
'type' => 'ul',
));
$handler->override_option('row_options', array(
'inline' => array(),
'separator' => '',
));
$handler->override_option('block_description', 'Queue \'notizie "in evidenza"\'');
$handler->override_option('block_caching', -1);
in that page i can only see the nodes that have been added to the queue. When i choose another language i get an empty page with no nodes.
i tried also without the current language filter but without success.
thanks in advance for your help, this is a great module!
#4
Here is mine as well:
$view = new view;$view->name = 'nodequeue_16';
$view->description = 'Display a list of all nodes in queue \'Front Page\'';
$view->tag = 'nodequeue';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('relationships', array(
'nodequeue_rel' => array(
'id' => 'nodequeue_rel',
'table' => 'node',
'field' => 'nodequeue_rel',
'label' => 'queue',
'required' => 1,
'limit' => TRUE,
'qids' => array(
'16' => '16',
),
'relationship' => 'none',
),
));
$handler->override_option('fields', array(
'title' => array(
'id' => 'title',
'table' => 'node',
'field' => 'title',
'label' => '',
'relationship' => 'none',
'link_to_node' => 1,
),
));
$handler->override_option('sorts', array(
'position' => array(
'id' => 'position',
'table' => 'nodequeue_nodes',
'field' => 'position',
'order' => 'ASC',
'relationship' => 'nodequeue_rel',
),
));
$handler->override_option('filters', array(
'status_extra' => array(
'id' => 'status_extra',
'table' => 'node',
'field' => 'status_extra',
'operator' => '=',
'value' => '',
'group' => 0,
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'relationship' => 'none',
),
'language' => array(
'operator' => 'in',
'value' => array(
'***CURRENT_LANGUAGE***' => '***CURRENT_LANGUAGE***',
'***NO_LANGUAGE***' => '***NO_LANGUAGE***',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => 'language_op',
'label' => 'Node translation: Language',
'use_operator' => 0,
'identifier' => 'language',
'optional' => 1,
'single' => 0,
'remember' => 1,
'reduce' => 0,
),
'id' => 'language',
'table' => 'node',
'field' => 'language',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('title', 'Queue \'Front Page\'');
$handler->override_option('items_per_page', 3);
$handler->override_option('use_pager', '0');
$handler->override_option('use_more', 1);
$handler->override_option('distinct', 1);
$handler = $view->new_display('page', 'Page', 'page');
$handler->override_option('path', 'nodequeue/16');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));
$handler = $view->new_display('block', 'Block', 'block');
$handler->override_option('fields', array(
'title' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
),
'link_to_node' => 1,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
'override' => array(
'button' => 'Use default',
),
),
'name' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
),
'link_to_taxonomy' => 0,
'exclude' => 0,
'id' => 'name',
'table' => 'term_data',
'field' => 'name',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'created' => array(
'label' => 'Post date',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
),
'date_format' => 'custom',
'custom_date_format' => 'M j',
'exclude' => 0,
'id' => 'created',
'table' => 'node',
'field' => 'created',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
));
$handler->override_option('items_per_page', 5);
$handler->override_option('style_plugin', 'grid');
$handler->override_option('style_options', array(
'grouping' => '',
'columns' => '4',
'alignment' => 'horizontal',
));
$handler->override_option('row_options', array(
'inline' => array(),
'separator' => '',
));
$handler->override_option('block_description', 'Queue \'Front Page\'');
$handler->override_option('block_caching', -1);
$handler = $view->new_display('block', 'Frontpage Block', 'block_1');
$handler->override_option('fields', array(
'created' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
),
'date_format' => 'custom',
'custom_date_format' => 'M j',
'exclude' => 0,
'id' => 'created',
'table' => 'node',
'field' => 'created',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'title' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 1,
'max_length' => '30',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 1,
),
'link_to_node' => 1,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
'override' => array(
'button' => 'Use default',
),
),
'field_event_photo_fid' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
),
'link_to_node' => 0,
'label_type' => 'none',
'format' => 'apartment_thumbnail_linked',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_event_photo_fid',
'table' => 'node_data_field_event_photo',
'field' => 'field_event_photo_fid',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'field_blog_image_fid' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
),
'link_to_node' => 0,
'label_type' => 'none',
'format' => 'apartment_thumbnail_linked',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_blog_image_fid',
'table' => 'node_data_field_blog_image',
'field' => 'field_blog_image_fid',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'field_event_flyer_image_fid' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
),
'link_to_node' => 0,
'label_type' => 'none',
'format' => 'apartment_thumbnail_linked',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_event_flyer_image_fid',
'table' => 'node_data_field_event_flyer_image',
'field' => 'field_event_flyer_image_fid',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'field_company_logo_fid' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
),
'link_to_node' => 0,
'label_type' => 'none',
'format' => 'apartment_thumbnail_linked',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_company_logo_fid',
'table' => 'node_data_field_company_logo',
'field' => 'field_company_logo_fid',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'field_apartment_photos_fid' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
),
'link_to_node' => 0,
'label_type' => 'none',
'format' => 'apartment_thumbnail_linked',
'multiple' => array(
'group' => 1,
'multiple_number' => '1',
'multiple_from' => '',
'multiple_reversed' => 0,
),
'exclude' => 0,
'id' => 'field_apartment_photos_fid',
'table' => 'node_data_field_apartment_photos',
'field' => 'field_apartment_photos_fid',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'field_dish_photo_fid' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
),
'link_to_node' => 0,
'label_type' => 'none',
'format' => 'apartment_thumbnail_linked',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_dish_photo_fid',
'table' => 'node_data_field_dish_photo',
'field' => 'field_dish_photo_fid',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'field_photo_fid' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
),
'link_to_node' => 0,
'label_type' => 'none',
'format' => 'apartment_thumbnail_linked',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_photo_fid',
'table' => 'node_data_field_photo',
'field' => 'field_photo_fid',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'field_venue_preview_image_fid' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
),
'link_to_node' => 0,
'label_type' => 'none',
'format' => 'apartment_thumbnail_linked',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_venue_preview_image_fid',
'table' => 'node_data_field_venue_preview_image',
'field' => 'field_venue_preview_image_fid',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'teaser' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 1,
'max_length' => '250',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 1,
),
'exclude' => 0,
'id' => 'teaser',
'table' => 'node_revisions',
'field' => 'teaser',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
));
$handler->override_option('sorts', array(
'position' => array(
'order' => 'ASC',
'id' => 'position',
'table' => 'nodequeue_nodes',
'field' => 'position',
'relationship' => 'nodequeue_rel',
'override' => array(
'button' => 'Use default',
),
),
));
$handler->override_option('filters', array(
'status_extra' => array(
'id' => 'status_extra',
'table' => 'node',
'field' => 'status_extra',
'operator' => '=',
'value' => '',
'group' => 0,
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'relationship' => 'none',
),
'language' => array(
'operator' => 'in',
'value' => array(
'***CURRENT_LANGUAGE***' => '***CURRENT_LANGUAGE***',
'***NO_LANGUAGE***' => '***NO_LANGUAGE***',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => 'language_op',
'label' => 'Node translation: Language',
'use_operator' => 0,
'identifier' => 'language',
'optional' => 1,
'single' => 0,
'remember' => 1,
'reduce' => 0,
),
'id' => 'language',
'table' => 'node',
'field' => 'language',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
));
$handler->override_option('header_format', '3');
$handler->override_option('header_empty', 0);
$handler->override_option('footer_format', '3');
$handler->override_option('footer_empty', 0);
$handler->override_option('style_plugin', 'grid');
$handler->override_option('style_options', array(
'grouping' => '',
'columns' => '3',
'alignment' => 'horizontal',
));
$handler->override_option('row_options', array(
'inline' => array(
'name' => 'name',
),
'separator' => '',
));
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);
". . . Can you clarify where the translated nodes are not appearing? . . ." - the nodes are not appearing in the view.
Treat translated nodes as single nodes is set in the nodequeue settings.
using Views - 6.x-2.3
Thanks.
#5
Same problem using :
Drupal 6.10
view 6.x-2.5
nodequeue 6.x-2.0
i18n 6.x-1.0
With default nodequeue generated view, translated nodes are not appearing in the view and in the queue manipuliation page.
Only source language nodes are appearing.
#6
Same problem here: I create a nodequeue and ensure "Treat translated nodes as single nodes" is set. I add several nodes to the queue (source, English versions). When I look at the queue either via an unaltered, default nodequeue view OR via the /admin/content/nodequeue/x/view page I see the source/English nodes. However, the queue does not change when I switch language (eg go to /fr/admin/content/nodequeue/x/view).
I was hoping nodequeues and corresponding views would handle this stuff, rather than resort to manually adding each translation to the nodequeue, then filtering by user language in the View... any suggestions? Is nodequeue (and the admin/content/nodequeue/x/view page) supposed to deal with selecting the correct translation node to display?
Drupal 6.10, Views 6.x-2.5, Nodequeue 6.x-2.0, i18n 6.x-1.0, Translation Helpers 6.x-1.x-dev
#7
Shifting this to the i18n queue. Please see my comment in #2. Based on my understanding of how i18n implements views support, this should be beyond the scope of Nodequeue. Am I missing something?
Any guidance here would be greatly appreciated by myself and the folks in this issue (and probably plenty of other people as well).
#8
I'm just working my head round this one as well.
In this case nodequeue just puts the nid of the source in. So obviously without doing anything the only node that will turn up is the one with the nid. When you stick i18n language_negotiation on it will then filter out any that don't meet the WHERE language criteria being used.
So you're going to have to add more nodes into the list to be filtered. Adding a join (relationship) on the translations would seem to be the obvious thing. But I'm yet to construct it so that I get the translated nodes themselves that relate to the original source nid stored in the nodequeue table. I'm not sure if it's possible with options so far.
#9
I think I have just reported a similar issue with the flag module:
http://drupal.org/node/511178
#10
@tomsm
Yes, think it's the same.
http://drupal.org/project/translation_helpers does the job so that only the original node and not its translations are actually in the nodequeue / flag tables.
However, when you then want to make view of this it will only show the the original node, not its translations. If you then add i18n filtering it may remove this as well (depending on mode).
The solution I believe is to make a join on the nodequeue / flag nid's with the translation tnids so they all end up in the view and can then be removed. The alternative is going to be putting all the nid's in the table (but I can see additional problems for nodequeue at least with this - queue length restrictions for a start).
[aside: I have written a solution for nodequeue (and an less working one for flag) for http://drupal.org/project/active_translation (which I intend to clean up and finish at some point). However it's easier there to do the look-up - just an inner join on a dedicated lookup table]
#11
Possibly more accurate, certainly clearer title. But does this belong as a support request in translation_helpers, nodequeue/flag, i18n or views issue queues ;) see my comment above for more.
#12
This is 'query rewriting' working as expected.
We need this one to better handle these issues #364001: Improve query rewriting and content selection: options, parameters, fine tuning
#13
hi - i ran into the same problem - was their any solution to this problem at the end?
#14
I fixed a similar problem with the flags module. Maybe the solution for this issue is similar?
Please see: http://drupal.org/node/511178
#15
I found the solution for Nodequeue translations with views:
You need to add 2 relationships in your view. The first one is 'Node translation: Source translation'. The second one is 'Nodequeue'. Set the first relationship as a relationship of the second relationship and set the second relationship as Required. Problem Solved!
Check the screenshot for the settings of the second relationship.
#16
Thank you Jasperknops for the advice!
#17
Hello Jasper,
Thank you for your solution! It's very helpful!
This could almost be the solution I need for this issue: #832116: Troubles setting up a multilingual ddblock using nodequeue
I'm using nodequeue to build a ddblock slider.
Before I found your solution I couldn't add translations of a node. They wouldn't show up automatically - only the originals were shown. With your solution all translations are automatically included properly, but only if there is at least 1 translated version of that node. If there is only single node (without translation) in the nodequeue, it won't show up at all.
Any ideas?
#18
Ok, I think it works great actually. If my nodequeue only allows 6 nodes, I can place 6 nodes in it + I can make as many translation nodes as I want. Great ! :)
#19
Hi,
I'm experiencing the same problems here.
What I want to achieve: editors just add a node to the queue (independent of language: this could be the source node or a translation) It gets registered and on the front end, the correct translation is shown within the view.
I've also the same setup: Views + NodeQueue + Translation Helper + i18n
* Nodequeue is configured to work in the 'Treat all translations as a single node' mode.
* i18n is set to work with Shown current language + language neutral nodes
* Three languages are defined: Dutch, English and French
I've tried to use Jasper Knops' solution but to no avail. I've also tried to change the 'Source Translation' relationship into the 'Node translation: translations' relationship. Just to get all the translations and show them in my view. No luck there.
I've taken the SQL query it generates and ran it manually on my database, it just returns 1 row. I would expect it to return 3 nodes. The original one + the translations. Then, with the 'translation negotation' filters, I would be able to filter out just the relevant nodes. It has probably to do with nodequeue's INNER JOIN throwing all nodes out ot the resultsset which are not part of the nodequeue_nodes table.
I'm in a tight spot here to get this sorted out.
Here's the SQL:
SELECT node.nid AS nid,nodequeue_nodes_node.position AS nodequeue_nodes_node_position
FROM node node
LEFT JOIN node node_node ON node.nid = node_node.tnid
INNER JOIN nodequeue_nodes nodequeue_nodes_node ON node_node.nid = nodequeue_nodes_node.nid AND nodequeue_nodes_node.qid = 2
WHERE node.status <> 0 OR (node.uid = ***CURRENT_USER*** AND ***CURRENT_USER*** <> 0) OR ***ADMINISTER_NODES*** = 1
ORDER BY nodequeue_nodes_node_position ASC
Here's my Nodequeue View:
$view = new view;$view->name = 'nodequeue_2';
$view->description = 'Display a list of all nodes in queue \'On aime\'';
$view->tag = 'nodequeue';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('relationships', array(
'translation' => array(
'label' => 'Translations',
'required' => 0,
'language' => 'all',
'id' => 'translation',
'table' => 'node',
'field' => 'translation',
'relationship' => 'none',
),
'nodequeue_rel' => array(
'label' => 'queue',
'required' => 1,
'limit' => 1,
'qids' => array(
'2' => 2,
'1' => 0,
'3' => 0,
'4' => 0,
'5' => 0,
),
'id' => 'nodequeue_rel',
'table' => 'node',
'field' => 'nodequeue_rel',
'relationship' => 'translation',
),
));
$handler->override_option('fields', array(
'title' => array(
'id' => 'title',
'table' => 'node',
'field' => 'title',
'label' => '',
'relationship' => 'none',
'link_to_node' => 1,
),
));
$handler->override_option('sorts', array(
'position' => array(
'id' => 'position',
'table' => 'nodequeue_nodes',
'field' => 'position',
'order' => 'ASC',
'relationship' => 'nodequeue_rel',
),
));
$handler->override_option('filters', array(
'status_extra' => array(
'id' => 'status_extra',
'table' => 'node',
'field' => 'status_extra',
'operator' => '=',
'value' => '',
'group' => 0,
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('title', 'Queue \'On aime\'');
$handler->override_option('use_pager', '1');
$handler->override_option('use_more', 1);
$handler->override_option('row_plugin', 'node');
$handler->override_option('row_options', array(
'teaser' => 1,
'links' => 1,
));
$handler = $view->new_display('page', 'Page', 'page');
$handler->override_option('path', 'nodequeue/2');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler = $view->new_display('block', 'Block', 'block');
$handler->override_option('items_per_page', 5);
$handler->override_option('use_pager', '0');
$handler->override_option('style_plugin', 'list');
$handler->override_option('style_options', array(
'type' => 'ul',
));
$handler->override_option('row_plugin', 'fields');
$handler->override_option('row_options', array(
'inline' => array(),
'separator' => '',
));
$handler->override_option('block_description', 'Queue \'On aime\'');
$handler->override_option('block_caching', -1);
#20
I imported your view to compare to mine. The only difference I could find was that in the Relationship - node translation: Translations - you have a dropdown called 'translation option' which i don't have. Changing the options, didn't make a difference.
When I test your view, it only displays results in the default language.
#21
Oh ok, I see now: You used 'Node translation: Translations' and I used 'Node translation: Source translation'. If I don't add a language filter, I see all the nodes.
I think I'm confused on what your issue is.
#22
thx. this is awesome.
#23
The Source Translation trick sort of worked for me, however if I have nodes that do not have a default-language translation then they still don't show in the View despite adding to the Nodequeue fine.
#24
The Source Translation trick sort of worked for me too. But it shows only nodes which are already translated. Nodes without translation are not shown.
Example:
Same when I put untranslated node in Spanish to nodequeue. Until I translated it its not shown in nodequeue.
I want to show all nodes in queue and than filter them via views lang filter Content translation: Language (= Current user's language).
I have tried to use "Content translation: Translations" setup to show ALL translations.
It really returns all nodes from my nodequeue, but setting up lang filter did nothing, still shows all translated nodes regardless of filter settings.
What I'm missing? It seems to me useless. I want simple thing: one multilingual limited (Queue size) nodequeue. So Internalization must be setup to "Treat translation nodes as a single node". And then display nodes in queue based on the current user language. It should not be dependent on whether the node is translated or not.
My setup:
Drupal 7.0
Internationalization 7.x-1.0-beta5
Translation helpers 7.x-1.x-dev
Nodequeue 7.x-2.0-alpha1
#25
I'd suggest you take a look at this module: http://drupal.org/project/smartqueue_language
#26
I have tested the solution as at #15 on my Drupal 7.4. It works only when the node has translations. If the node is set to content neutral, it is not shown at all. Is there any way to display both "translations of current language (with url negotiation, i.e. http://xxx/en/content)" and "content which is language neutral" ?
#27
In hook_nodeapi I add the current nid as tnid on node create, if the node has no tnid yet. This way a node without translation will be displayed.
#28
Dear jasperknops (#27), would you tell in more detail how should we "add the current nid as tnid on node create"? Thank you!!!
#29
@netsensei Thanx, I'm still looking for solution for Drupal 7 :/
#30
Thanx, I'm still looking for solution for Drupal 7 :/
#31
#15 Amazing!! - have been searching for a solution for this for a while.
Thanks so much!
#32
Hooray for #15... Working on my first dual-language site, and this thread was extremely helpful.
#33
Thanks a lot jasperknops for the very very usefull post!