Closed (fixed)
Project:
Apache Solr Search
Version:
6.x-3.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Mar 2013 at 16:51 UTC
Updated:
6 Jun 2013 at 22:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
nick_vhThis should fix it. D6 is a little messy though.
Comment #2
kevin.dutra commentedThe logic makes sense, but in practice, I run into an issue with double URL encoding. As an example, after doing a Save and Edit on a search environment, the values end up being:
Referer:
http://<domain>/admin/settings/apachesolr/settings/<env_id>/edit?destination=admin%2Fsettings%2Fapachesolr%2FsettingsRequest:
http://<domain>/admin/settings/apachesolr/settings/<env_id>/edit%3Fdestination%3Dadmin%252Fsettings%252Fapachesolr%252FsettingsThis appears to be because
url()encodes the whole $path argument. (It expects any query params to be passed in via the $options argument to protect the query portion from being double encoded.) Because of the double encoding, the strings don't evaluate to be equal.Comment #3
nick_vhI see, so what about this? This logic is not perfect and will, if your referer_uri has query params, not function as expected but at least it solves the problem for most of the use cases.
If this passes the tests I'm thinking of committing this directly.
Comment #4
kevin.dutra commentedThat definitely works in the case of search pages, but the edit links for search environments are constructed with the destination query param specified specified.
Comment #5
nick_vhSeems that drupal does not respect its own API? request_uri with the argument TRUE should omit the query string. See http://api.drupal.org/api/drupal/includes!bootstrap.inc/function/request...
But in the case of the search environments it does keep the query params for some reason. We might need a regex to get rid of that. Attached is a patch that tries that
Comment #6
kevin.dutra commentedAh, the argument for omitting the query string doesn't pop up until the D8 version of the function.
Comment #7
nick_vhOh, must have overlooked that. Removing it from the patch
Comment #8
nick_vhShould be good this time
Comment #9
nick_vhSome spacing issue
Comment #10
nick_vhTested and committed. Thanks for the help