Currently the "plain" URL Formatter trims off the query string and named anchors. This patch corrects the URLs to include all the information.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Status: Needs review » Fixed

Looks like the Drupal 5 version doesn't suffer from this problem. I've committed to the Drupal 6 version.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

Summit’s picture

Version: 6.x-2.5 » 7.x-1.x-dev
Status: Closed (fixed) » Active

Hi, setting to active again on D7 if thats ok.
Could this issue be still there for the D7 version?
I have tried several Link fields, and the query strings seem to get lost..
See for example issue: http://drupal.org/node/1397700#comment-5443574
Greetings, Martijn

Summit’s picture

Status: Active » Closed (duplicate)

Hi, Sorry I see this issue for D7, setting this to duplicate if thats ok: http://drupal.org/node/1321482
greetings, Martijn

Summit’s picture

Version: 7.x-1.x-dev » 6.x-2.x-dev
Priority: Normal » Critical
Status: Closed (duplicate) » Active

Hi, Setting this to active on D6 again.
I use shorturl module on D6, but on D6 still Link breaks of the query string and named anchors when using together with custom formatters. The patch on http://drupal.org/node/1309658 didn't help on D6.
Sorry if wrong set to active again.
Greetings, Martijn

dqd’s picture

Priority: Critical » Normal

But it doesn't break the site completely nor is it a security risk, please use "critical" carefully.

Thanks for understanding.
And thanks for the report, much appreciated.

Summit’s picture

Hi, Set this to critical not on purpose, wanted to set it to active only, sorry!
Greetings, Martijn

dqd’s picture

Assigned: quicksketch » dqd

Not sure if it sticks together but this issue #1321482: Query string and fragment are removed has been fixed, committed and pushed to HEAD. Can you please recheck if the errors persist in D7 latest --dev? If not we can assume that we can solve this the same way on D6 maybe

dqd’s picture

Assigned: dqd » Unassigned
Status: Active » Postponed (maintainer needs more info)

I think we need some reviews and tests on the latest --dev versions of the link module, since there were some commits in the last nights ...

I still can't reproduce it ...

das-peter’s picture

Assigned: Unassigned » quicksketch
Status: Postponed (maintainer needs more info) » Active
FileSize
105.17 KB

I've just tested this with these url's:

http://www.example.com/?query=x#nq
http://www.example.com?query=x&y=1#nq
http://www.example.com/?query[]=x&query[y]=1#nq
http://www.example.com/?query[]=x&query[y]=1
http://example.com/index.php?menu=10&id=20
my/site?query[]=x&query[y]=1#nq

Test-Setup:
Field-Settings: See attached image
Output by Views: Used fields, output formatter URL, as plain text
Modules: About ~67 other modules are enabled in this installation. But no workbench_moderation.

Unfortunately I can't reproduce the issue. The URL is displayed as expected.

das-peter’s picture

Assigned: quicksketch » Unassigned
Status: Active » Postponed (maintainer needs more info)

*grml* cross post :)

virtualdrupal’s picture

I've got one for you, saves into the database fine but when displayed in views or display suite (using any url format method), parts of the query are stripped out.

http://www.example.more.example.com/something/display_details.aspx?fun=Y...

Ends up displaying as:

http://www.example.more.example.com/something/display_details.aspx?num=1...

Removing the following from link.module resolves it

  if (strpos($url, '?') !== FALSE) {
    $query = substr($url, strpos($url, '?') + 1);
    parse_str($query, $query_array);
    $item['query'] = $query_array;
    $url = substr($url, 0, strpos($url, '?'));
  }
dqd’s picture

@virtualroberts: please use the given 'code' tags to post code in issue comments, I would like to ask you to edit your comment.

thanks for understanding, and thanks for the report but please be careful with providing info of removing code since some code interrelates to url validation, which is important for security like f.e. to prevent some server mailware with obfuscated code urls to procreate its damage.

virtualdrupal’s picture

@Digidog: done. Any thoughts on a better way of getting those urls to operate properly?

naeluh’s picture

Hi I am having this issue also. In d7. Is there a duplicate thread for d7.

ohthehugemanatee’s picture

Issue summary: View changes
FileSize
849 bytes

I can't believe this issue still exists... but it got me on a D7 site today. Submitting the patch suggested here 7 years ago to see what breaks. At this point, there may be code out there that depends on $wrapper->url returning the display URL... let's see how the tests go.

DamienMcKenna’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Thank you all for your efforts, but I'm sorry to say that the D6 version is no longer supported.