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

pjsz - June 5, 2009 - 18:00
Project:Prepopulate
Version:6.x-2.x-dev
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

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.

#1

lelizondob - July 29, 2009 - 18:56

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

#2

bentonboomslang - September 8, 2009 - 12:29
Version:6.x-1.1» 6.x-2.x-dev

This is happening with me too.

Surely others must have solved this...

Thanks,

Ben

#3

lelizondob - September 8, 2009 - 16:27

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

bentonboomslang - September 10, 2009 - 09:07

This worked tremendously.

Thanks a lot lelinzondob.

Ben

#5

jbrauer - September 15, 2009 - 04:42
Status:active» fixed

#6

System Message - September 29, 2009 - 04:50
Status:fixed» closed

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

#7

tpainton - November 9, 2009 - 18:05

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?

 
 

Drupal is a registered trademark of Dries Buytaert.