Closed (cannot reproduce)
Project:
Views (for Drupal 7)
Version:
6.x-2.11
Component:
page displays
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Jul 2009 at 22:21 UTC
Updated:
13 Feb 2011 at 09:22 UTC
When I use "Rewrite the output of this field" and "Output this field as a link" the link created has %0A and spaces so the link goes to a page not found.
Comments
Comment #1
DragoonBootsI found this happening to me too with the stable 6.x-2.6. It seems to be because when Views processes each field, it adds a linebreak to some of the empty fields. This means that when the URL is formed, those line breaks come with it. Views would need to be patched to not insert linebreaks in empty fields.
Comment #2
fakechilly commentedHi,
I am relatively new to drupal and have stumbled upon the same problem.. did u find a work around to make views use hyphens instead of such characters as URL in "Output this field as a link".... plz share it coz this is very important for my site... i just can't figure it out...
Thanks
Comment #3
pix_ commentedI'm having the same problem. Rewriting a node-title output as link and using [update_fid] as replacement pattern result in a "sites/all/default/filename.ext%0A" which break the link. on both 6.x-2.6 and 6.x-2.7. I managed to avoid this by changing approch: I rewrited the output of my "Upload:attached files" field using [title] as replacement pattern. on 6.x-2.7
Comment #4
wretched sinner - saved by grace commentedI had a view working in 2.6 (from memory) which has broken in 2.7 - as with the others, I am getting a file path with
%0A%20%20before and%0A%0Aafter.Comment #5
dawehnerthis was the wrong issue, sorry.
Comment #6
bewhy commentedI'm facing the same issue using 6.x-2.11, so I am changing the version number
The "Output This Field as a Link" is not working as described above.
The "Rewrite the output of this field" is working properly.
Comment #7
dawehnerWhat do you put into the fields? It would be cool if someone could export a view.
Comment #8
bewhy commentedderiene, export the view: great idea. thanks for the nudge, this is the first time I've ever exported a view, or looked at the raw code of it, it's a great learning experience.
I was attempting to link the 'user name' and 'user picture' fields with the 'node: title' field instead of linking to the user. The node-type was a gallery that the user created, I wanted people to click on either the user name or user picture and be sent to the picture gallery that they created.
When I check 'Output this field as a link' and input the token '[title]' or 'gallery/[title]' (to get the correct path) the link reads be "gallery/user name" instead of "gallery/user-name"
$view = new view;
$view->name = 'topness';
$view->description = 'Top content and stuff';
$view->tag = 'content, rating, top';
$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(
'votingapi_cache_1' => array(
'label' => 'Vote results',
'required' => 0,
'votingapi' => array(
'value_type' => 'percent',
'tag' => 'vote',
'function' => 'average',
),
'id' => 'votingapi_cache_1',
'table' => 'node',
'field' => 'votingapi_cache',
'relationship' => 'none',
),
));
$handler->override_option('fields', array(
'counter' => array(
'label' => 'Rank',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'counter_start' => '1',
'exclude' => 0,
'id' => 'counter',
'table' => 'views',
'field' => 'counter',
'relationship' => 'none',
),
'title' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 1,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
),
'picture' => array(
'label' => 'Picture',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 1,
'path' => '[title]',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'imagecache_preset' => 'profile',
'exclude' => 0,
'id' => 'picture',
'table' => 'users',
'field' => 'picture',
'relationship' => 'none',
),
'value' => array(
'label' => 'Rating',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 1,
'path' => '[title]',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'set_precision' => 0,
'precision' => '0',
'decimal' => '.',
'separator' => ',',
'prefix' => '',
'suffix' => '',
'appearance' => 'fivestar_views_value_display_handler',
'exclude' => 0,
'id' => 'value',
'table' => 'votingapi_cache',
'field' => 'value',
'relationship' => 'votingapi_cache_1',
),
));
$handler->override_option('sorts', array(
'value' => array(
'order' => 'DESC',
'id' => 'value',
'table' => 'votingapi_cache',
'field' => 'value',
'relationship' => 'votingapi_cache_1',
),
));
$handler->override_option('filters', array(
'status' => array(
'operator' => '=',
'value' => '1',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'status',
'table' => 'node',
'field' => 'status',
'relationship' => 'none',
),
'type' => array(
'operator' => 'in',
'value' => array(
'gallery' => 'gallery',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
'grouping' => '',
'override' => 1,
'sticky' => 0,
'order' => 'desc',
'columns' => array(
'field_gallery_image_fid' => 'field_gallery_image_fid',
'title' => 'title',
'name' => 'name',
'picture' => 'picture',
'function' => 'function',
),
'info' => array(
'field_gallery_image_fid' => array(
'separator' => '',
),
'title' => array(
'sortable' => 1,
'separator' => '',
),
'name' => array(
'sortable' => 0,
'separator' => '',
),
'picture' => array(
'sortable' => 0,
'separator' => '',
),
'function' => array(
'sortable' => 1,
'separator' => '',
),
),
'default' => 'function',
));
$handler = $view->new_display('page', 'Top Models', 'page_1');
$handler->override_option('fields', array(
'counter' => array(
'label' => 'Rank',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'counter_start' => '1',
'exclude' => 0,
'id' => 'counter',
'table' => 'views',
'field' => 'counter',
'relationship' => 'none',
),
'title' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 1,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
),
'picture' => array(
'label' => 'Picture',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 1,
'path' => '[title]',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'imagecache_preset' => 'profile',
'exclude' => 0,
'id' => 'picture',
'table' => 'users',
'field' => 'picture',
'relationship' => 'none',
'override' => array(
'button' => 'Use default',
),
),
'value' => array(
'label' => 'Rating',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 1,
'path' => 'gallery/[title]',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'set_precision' => 0,
'precision' => '0',
'decimal' => '.',
'separator' => ',',
'prefix' => '',
'suffix' => '',
'appearance' => 'fivestar_views_value_display_handler',
'exclude' => 0,
'id' => 'value',
'table' => 'votingapi_cache',
'field' => 'value',
'relationship' => 'votingapi_cache_1',
'override' => array(
'button' => 'Use default',
),
),
));
$handler->override_option('path', 'topmodels');
$handler->override_option('menu', array(
'type' => 'normal',
'title' => 'Top Models',
'description' => '',
'weight' => '0',
'name' => 'primary-links',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
Comment #9
iamjon commentedBeWhy,
did you ever find a solution for this?
i tried importing your view but i'm missing something. can you provide simple replication instructions (preferably using stuff using basic fields)
Comment #10
iamjon commentedClosing from lack of activity. Please feel free to reopen with new information.