I have a views page with several exposed filters. I have created a link using a view php field as per below:
$url = '/admin/dashboard/applications/create/' . $row->nid . '?destination=' . current_path() . '&' . $_SERVER['QUERY_STRING']; $link = '<a class="create-app" href="' . $url . '" title="Create application">App+</a>';
This leads to a form page with a confirmation 'Submit' or 'Cancel' button. The resulting URL on that page being something like this:
When the redirect is done, the querystring after ?destination=admin/dashboard/enquiries is removed. I think this happens because it is not URL encoded.
I then tried url encoding the link as per below:
$query_string = array('destination' => current_path() . '&' . $_SERVER['QUERY_STRING']); $url = url('admin/dashboard/applications/create/' . $row->nid, array('query' => $query_string)); $link = '<a class="create-app" href="' . $url . '" title="Create application">App+</a>';
This creates the following url:
The issue now is that when the redirect is done back to the views page, views does not recognize the URL query and does not load the view, and falls back to the parent menu callback.