OK i have some pages with custom code that use HTTP_GET query strings to pull out specific information. The query string defines what’s on the page and to the user if the query string is different then the page appears different.

Would it be possible to adjust the Bookmarks module to also save what’s in the query string as well as the node?

EXAMPLE:
I have a page that serves up employee details based on the employee ID in the query string I want users to be able to bookmark a particular student:
http://www.thetraininghub.co.uk/employee-details?stuid=19282

Comments

Anonymous’s picture

Version: 6.x-2.2 » master
Status: Active » Postponed

There are some issues with doing this but I'll keep it on the list for a future improvement. I'm surprised that none of my users have mentioned this.

dawehner’s picture

what do you mean with some issues?

i would like to solve this problem here

the menu system can save this kind of links

stevenpatz’s picture

Title: Bookmars to include Query strings » Bookmarks to include Query strings
Anonymous’s picture

Yes, the menu system can save these kind of links as can the bookmarks module. The issues are a result of using the 'Add this page' link which doesn't support query strings at the moment.

Please note that this will happen, it just requires that I have some time to implement it. And time is a resource that I have run out of as of late.

Anonymous’s picture

Status: Postponed » Fixed

Fixed in 6.x-2.4.

Status: Fixed » Closed (fixed)

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

norio’s picture

Thanks for this awesome module, darthclue :)

This isn't quite fixed though.

If I try to save this:
http://example.com/contacts?group[]=1&country=South+Africa&name=Norio&lastname=De+Sousa

It gets saved as this:
http://example.com/contacts?&group=Array&country=South%20Africa&name=Norio&lastname=De%20Sousa

I solved it by replacing this: (bookmarks.module; Lines: 296-299)

$query_string = '';
foreach ($query_variables as $key => $value) {
  $query_string .= '&' . $key . '=' . $value;
}

With this:

$query_string = preg_replace("/q=[^&]+&/", "", $_SERVER["QUERY_STRING"]);

It's probably not the best way to do it but it works.

I also noticed a problem with your redirect when query strings are involved.

See:
http://drupal.org/node/247585#comment-1433480

I solved it by replacing this: (bookmarks.admin.inc; Lines: 495-498)

//If the redirect_after value is set, send them there.
if ($item['redirect_after']) {
  $form_state['redirect'] = $item['redirect_after'];
}

With this:

//If the redirect_after value is set, send them there.
if ($item['redirect_after']) {
  list($redirect_path, $redirect_query) = explode("?", $item['redirect_after']);
  $form_state['redirect'] = array($redirect_path, $redirect_query);
}

Works perfectly now :) Thanks again for the cool module!

PS: There are some security problems, too. Specifically, SQL queries where you're not using '%d' and '%s', etc. Just a heads-up.

Larry_H’s picture

Status: Closed (fixed) » Needs work

I am using Bookmarks version 6.x-2.9 and am have discovered that the Add this page function does not work when a query string is included. The following search will work: example.com/search/apachesolr_search/dropout however these next two will not:
1) example.com/search/apachesolr_search/dropout prevention (nor dropout%20prevention)
2) example.com/search/apachesolr_search/"dropout prevention"

I am not sure if making the changes that norio above suggests will work or are prudent.

I too find it interesting that I have search for a while and this is the first mention of this problem. We have had the module for only 2 weeks.

This feature would make the bookmarks module extremely useful for us.

thank you

stevenpatz’s picture

Status: Needs work » Closed (fixed)
Larry_H’s picture

Why did you just close this? It isn't working.

stevenpatz’s picture

Open a new issue then.