Hi all,
Thank you for this fantastic module.
I've noticed that if the URL of the link contains parametrs, the resulting URL is not encoded properly, resulting in a broken link.
(e.g. this URL breaks: news?field_cat_new_tid_i18n[0]=1)
This is because parameters aren't processed accordingly in the l() function when preprocessing the block.
I think this is a major issue.
I wrote a quick workaround patch:
line 126 - function block_titlelink_preprocess_block - block_titlelink.module
//Separate parameters
$url = explode('?', $vars['block']->title_link);
if (isset($url[1])) {
$attributes['query'] = array();
$params = explode('&', $url[1]);
foreach($params as $p) {
//Update attributes array with corresponding params
$auxParam = explode('=', $p);
$attributes['query'][$auxParam[0]] = $auxParam[1];
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | block_titlelink-1681204-2.patch | 2.48 KB | autopoietic |
Comments
Comment #1
autopoietic commentedI also needed to have query strings on block title links, in my case so that the link would configure exposed filters on a view.
I have created the attached patch similarly to @bmunslow but instead of breaking off the querystring into parameters in the preprocess function I opted to do this in the submit handler and save the querystring array separately.
The patch works for me anyway.
Comment #2
autopoietic commentedComment #3
adammaloneThanks - I think I'll use drupal_parse_url on this.
Comment #4
adammaloneThis code will be committed soon - if people have thoughts or additional extras it can be discussed here:
Comment #5
drupalpal commentedThis not pushed to the latest dev or stable release? right?
I had to add it manually....
Comment #6
adammalonePushed to latest dev, thanks!