Problem/Motivation

I've tried to make a block title link to:
reading-room?tid=11

The module translates this into:
reading-room%3Ftid%3D11

Which does not link to the correct page.

Remaining tasks

CommentFileSizeAuthor
#12 punctuation_in_link-1013700-12.patch721 bytessumitmadan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ngmaloney’s picture

Assigned: Unassigned » ngmaloney

Will work on a patch. Thanks for filing.

ngmaloney’s picture

This turns out to be an interesting bug (I think). I'm using the l function to generate the URL. That function passes the URL, in this case, reading-room?tid=11, to the url function. The url function escapes query strings and expects them to be passed separately as an options arguments.

The fact that the string escape is happening on the api level makes this a challenge. I'll need to seek some advice on how best to handle this use case. For now, i'll leave this ticket open as I would like to resolve this issue.

ngmaloney’s picture

@madmatter23 as a quick work around, specify an absolute URL and it will by pass the string escaping.

grasmash’s picture

Great! Thanks for the info. An absolute URL should work fine for now.

neclimdul’s picture

@ngmaloney Yeah, that's exactly what's happening in l(). I've run into similar problems when having modules link to solr which specifies facets in the query string.

There are 2 options that come to mind for dealing with this.
1) just split the path on ? and use the first part as the path for l(). This would probably fail if there was and fragment though so you'd have to special case that as well.
2) use parse_url() to break up the url and then reform it into arguments to l(). You'll need to add extra logic or just bypass the parse_url() logic for absolute urls though.

ngmaloney’s picture

Status: Active » Postponed

Postponed. Need maintainer for D6 branch.

Dennis Cohn’s picture

sorry wrong forum

ngmaloney’s picture

Assigned: ngmaloney » Unassigned
Status: Postponed » Active

I'm no longer actively maintaining the Drupal 6 version of the block_titlelink module except for critical and security related bugs. I'll gladly grant contrib access or release an update if anyone wishes to roll a patch.

JKingsnorth’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)

Can someone confirm whether this is still a problem in the 6.x-2.0 branch?

rsvelko’s picture

I checked now in git and for the 6.x-2.x its not fixed.
It IS fixed in latest git for 7.x - so go in there on line 146 and migrate/backport the changes into 6.x

adammalone’s picture

Status: Postponed (maintainer needs more info) » Needs work
Issue tags: +Novice

If someone wants to provide a patch to get this into the Drupal 6 version I'll get that rolled in. It seems like an easy win so I've added the novice tag.

sumitmadan’s picture

Created a patch, hope it is the correct thing to do.

sumitmadan’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 12: punctuation_in_link-1013700-12.patch, failed testing.

sumitmadan’s picture

Version: 6.x-1.6 » 6.x-2.0
Status: Needs work » Needs review

Sorry forgot to change the version. Patch is against the 6.x-2.0.

Anybody’s picture

Does the problem also exists in D7 version? Can we get some more feedback on the patch?

Anybody’s picture

Confirming that D7 version does NOT have this issue anymore.

Christie Alcidor’s picture

Issue summary: View changes
Christie Alcidor’s picture

Christie Alcidor’s picture

Status: Needs review » Closed (outdated)

This is outdated and is not supported anymore.