Download & Extend

passing a prepopulate style url through drupal's url() breaks the url

Project:Prepopulate
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Drupal's url() is changing the '[' to %3 ... and breaking the prepopulate urls. Any ideas on what to do about this?

Thanks for a great module.

Comments

#1

in my case it breaks the '?' and the '=' it changes them to %3F.. still don't know how to solve this.

#2

Version:6.x-1.1»

This is happening with me too.

Surely others must have solved this...

Thanks,

Ben

#3

I'm using this code to prepopulate a field:

$project = arg(1);
$populate = l('+ '. t('Create !type', array('!type' => $link['title'])), $link['href'], array('query' => 'edit[field_project_ref][0][nid]='.urlencode($project)));

In this case using array('query' ... solved the mystery.

#4

This worked tremendously.

Thanks a lot lelinzondob.

Ben

#5

Status:active» fixed

#6

Status:fixed» closed (fixed)

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

#7

Is there another way to do this.. It seems to be my problem as well. I am using computed field to generate a url that should prepopulate but the ampersand is getting turned into %26 and once this happens, the link no longer works.

It seems this solution works, but I am not sure how to modify it to my needs. Seems like prepopulate should do this for you? Feature request?

#8

Hi,
where is this code added in order to prepopulate the field?

#9

it depends... in my case the link was in template.php since I was overriding a function and that's where I put it, but if you have the link in a block, there's where you need to add the code.

nobody click here