Hi,
I have a problem using Link + Views with the following context :
- The views display an image with "ouput as a link" feature
- In "ouput as a link" I use a Link field
- The link field contains http://mysite.dev/search?f[0]=field_vp_node_eb%253Afield_sp%3A2701
When the view build the content, it passes trough :
- link_field_prepare_view()
- _link_sanitize()
- _link_parse_url()
In _link_parse_url(), the result array is :
$url_parts = array(
'query' => array(
'f[0]' => 'field_vp_node_eb%253Afield_sp%3A2701',
),
'url' => 'http://mysite.dev/search',
);
This is wrong as f[0] is an array and not a simple key.
So then, when it passes trough url(), the characters "[" and "]" are encoded and the url doesn't work anymore.
The correct parsing, as it can be retrieve using drupal_parse_url() should be :
$url_parts = array(
'query' => array(
'f' => array(
0 => 'field_vp_node_eb%253Afield_sp%3A2701',
),
),
'url' => 'http://mysite.dev/search',
);
I think the simplest solution is to replace _link_parse_url() by drupal_parse_url() but I'm not sure of the impact.
Comment | File | Size | Author |
---|---|---|---|
#2 | link-fix_parse_url-2891922-2.patch | 1.15 KB | Nixou |
Comments
Comment #2
Nixou CreditAttribution: Nixou commentedAttach is the patch with the drupal_parse_url() solution.